Shortcuts

Softsign

class torch.nn.Softsign(*args, **kwargs)[源代码]

应用逐元素的Softsign函数。

SoftSign(x)=x1+x\text{SoftSign}(x) = \frac{x}{ 1 + |x|}
Shape:
  • 输入:()(*),其中 * 表示任意数量的维度。

  • 输出: ()(*), 与输入形状相同。

../_images/Softsign.png

示例:

>>> m = nn.Softsign()
>>> input = torch.randn(2)
>>> output = m(input)
优云智算