捷徑

ELU

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

逐元素 (element-wise) 應用指數線性單元 (Exponential Linear Unit, ELU) 函數。

此方法描述於論文:Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs)

ELU 定義為

ELU(x)={x, if x>0α(exp(x)1), if x0\text{ELU}(x) = \begin{cases} x, & \text{ if } x > 0\\ \alpha * (\exp(x) - 1), & \text{ if } x \leq 0 \end{cases}
參數
  • alpha (float) – ELU 公式中的 α\alpha 值。預設值:1.0

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

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

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

../_images/ELU.png

範例

>>> m = nn.ELU()
>>> 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