silu

Contents

silu#

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

SiLU (Sigmoid Linear Unit) activation function.

Computes the element-wise function:

\[\mathrm{silu}(x) = x \cdot \mathrm{sigmoid}(x) = \frac{x}{1 + e^{-x}}\]
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

See also

sigmoid

The sigmoid function.

swish

Alias for silu.

Notes

swish and silu are both aliases for the same function.