評價此頁

Mish#

class torch.nn.Mish(inplace=False)[source]#

逐元素應用 Mish 函式。

Mish: A Self Regularized Non-Monotonic Neural Activation Function.

Mish(x)=xTanh(Softplus(x))\text{Mish}(x) = x * \text{Tanh}(\text{Softplus}(x))
形狀
  • 輸入: ()(*),其中 * 表示任意數量的維度。

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

../_images/Mish.png

示例

>>> m = nn.Mish()
>>> input = torch.randn(2)
>>> output = m(input)
extra_repr()[source]#

返回模組的額外表示。

返回型別

str

forward(input)[source]#

執行前向傳播。

返回型別

張量