捷徑

CELU

class torch.nn.CELU(alpha=1.0, inplace=False)[source][source]

以元素方式套用 CELU 函數。

CELU(x)=max(0,x)+min(0,α(exp(x/α)1))\text{CELU}(x) = \max(0,x) + \min(0, \alpha * (\exp(x/\alpha) - 1))

更多細節請參考論文 Continuously Differentiable Exponential Linear Units

參數
  • alpha (float) – CELU 公式中的 α\alpha 值。預設值:1.0

  • inplace (bool) – 可以選擇是否就地 (in-place) 執行操作。預設值:False

形狀
  • 輸入:()(*),其中 * 代表任意數量的維度。

  • 輸出:()(*),與輸入形狀相同。

../_images/CELU.png

範例

>>> m = nn.CELU()
>>> input = torch.randn(2)
>>> output = m(input)

文件

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources