Hardshwink module
Applies the hard shrinkage function element-wise:
nn_hardshrink(lambd = 0.5)
lambd |
the λ value for the Hardshrink formulation. Default: 0.5 |
\mbox{HardShrink}(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_hardshrink() input <- torch_randn(2) output <- m(input) }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.