tanh_shrink

Contents

tanh_shrink#

class brainstate.nn.tanh_shrink(x)[source]#

Tanh shrink activation function.

Applies the element-wise function:

\[\text{Tanhshrink}(x) = x - \tanh(x)\]
Parameters:

x (ArrayLike) – Input array.

Returns:

Output array with the same shape as the input.

Return type:

jax.Array or Quantity