stanh¶

paddle.fluid.layers.nn. stanh ( x, scale_a=0.67, scale_b=1.7159, name=None ) [source]

stanh activation.

$out = b * \frac{e^{a * x} - e^{-a * x}}{e^{a * x} + e^{-a * x}}$
Parameters
• x (Tensor) – The input Tensor with data type float32, float64.

• scale_a (float, optional) – The scale factor a of the input. Default is 0.67.

• scale_b (float, optional) – The scale factor b of the output. Default is 1.7159.

• name (str, optional) – Name for the operation (optional, default is None). For more information, please refer to Name.

Returns

A Tensor with the same data type and shape as x .

Examples