soft_sign

Contents

soft_sign#

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

Soft-sign activation function.

Computes the element-wise function:

\[\mathrm{soft\_sign}(x) = \frac{x}{|x| + 1}\]
Parameters:

x (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – Input array.

Returns:

An array with the same shape as the input.

Return type:

Array | Quantity