hard_shrink

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

HardShrink激活函数(HardShrink activation operator)

hard_shrink - 图1

  • 参数:
    • x - HardShrink激活函数的输入
    • threshold (FLOAT)-HardShrink激活函数的threshold值。[默认:0.5]

返回:HardShrink激活函数的输出

代码示例

  1. import paddle.fluid as fluid
  2. data = fluid.layers.data(name="input", shape=[784])
  3. result = fluid.layers.hard_shrink(x=data, threshold=0.3)