softshrink

  • paddle.fluid.layers.softshrink(x, alpha=None)[源代码]

Softshrink激活函数

softshrink - 图1

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

返回: 张量(Tensor)

返回类型: 变量(Variable)

代码示例

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