Softshrink#
- class torch.nn.Softshrink(lambd=0.5)[source]#
Element-wise apply the soft shrinkage function.
- 参数
lambd (float) – The value for the Softshrink formulation. (Must be no less than zero). Default: 0.5
- 形状
Input: , where means any number of dimensions.
Output: , same shape as the input.
示例
>>> m = nn.Softshrink() >>> input = torch.randn(2) >>> output = m(input)