Softsign¶ class torch.nn.Softsign(*args, **kwargs)[source][source]¶ 逐元素應用 Softsign 函式。 SoftSign(x)=x1+∣x∣\text{SoftSign}(x) = \frac{x}{ 1 + |x|} SoftSign(x)=1+∣x∣x 形狀 輸入: (∗)(*)(∗),其中 ∗*∗ 表示任意維數。 輸出: (∗)(*)(∗),與輸入具有相同的形狀。 示例 >>> m = nn.Softsign() >>> input = torch.randn(2) >>> output = m(input)