Softshrink module
Applies the soft shrinkage function elementwise:
nn_softshrink(lambd = 0.5)
lambd |
the λ (must be no less than zero) value for the Softshrink formulation. Default: 0.5 |
\mbox{SoftShrinkage}(x) = ≤ft\{ \begin{array}{ll} x - λ, & \mbox{ if } x > λ \\ x + λ, & \mbox{ if } x < -λ \\ 0, & \mbox{ otherwise } \end{array} \right.
Input: (N, *) where *
means, any number of additional
dimensions
Output: (N, *), same shape as the input
if (torch_is_installed()) { m <- nn_softshrink() input <- torch_randn(2) output <- m(input) }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.