softshrink¶
- paddle.fluid.layers. softshrink ( x, alpha=None ) ¶
Softshrink 激活函数
\[\begin{split}out = \begin{cases} x - \alpha, \text{if } x > \alpha \\ x + \alpha, \text{if } x < -\alpha \\ 0, \text{otherwise} \end{cases}\end{split}\]
参数¶
x (Variable0 - 张量(Tensor)
alpha (float) - 上面公式中 alpha 的值
返回¶
张量(Tensor)
返回类型¶
变量(Variable)
代码示例¶
COPY-FROM: paddle.fluid.layers.softshrink