Skip to content

Latest commit

 

History

History
46 lines (21 loc) · 704 Bytes

softshrink_cn.rst

File metadata and controls

46 lines (21 loc) · 704 Bytes

softshrink

Softshrink激活函数

$$\begin{aligned} out = \begin{cases} x - \alpha, \text{if } x > \alpha \\\ x + \alpha, \text{if } x < -\alpha \\\ 0, \text{otherwise} \end{cases} \end{aligned}$$

参数:
  • x (Variable0 - 张量(Tensor)
  • alpha (float) - 上面公式中alpha的值

返回: 张量(Tensor)

返回类型: 变量(Variable)

代码示例

import paddle.fluid as fluid
data = fluid.layers.data(name="input", shape=[32, 784])
result = fluid.layers.softshrink(data)