评价此页

Softsign#

class torch.nn.Softsign(*args, **kwargs)[source]#

逐元素应用 Softsign 函数。

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

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

../_images/Softsign.png

示例

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