e3x.nn.activations.swish
- e3x.nn.activations.swish(x)
SiLU/Swish activation function.
Computes the gated linear activation with:
\[\mathrm{gate}(x) = \mathrm{sigmoid}(x)\]For scalar inputs, this is equivalent to:
\[\mathrm{silu}(x) = x \cdot \mathrm{sigmoid}(x) = \frac{x}{1 + e^{-x}}\]- Parameters:
x (
Union[Float[Array, '... 1 (max_degree+1)**2 num_features'], Float[Array, '... 2 (max_degree+1)**2 num_features']]) – Input features to which the nonlinearity is applied.- Return type:
- Returns:
The result of applying the nonlinearity to the input features.