e3x.nn.activations.leaky_relu
- e3x.nn.activations.leaky_relu(x, negative_slope=0.01)[source]
Leaky rectified linear unit activation function.
Computes the gated linear activation with:
\[\begin{split}\mathrm{gate}(x) = \begin{cases} 1, & x \ge 0\\ \alpha, & x < 0 \end{cases}\end{split}\]For scalar inputs, this is equivalent to:
\[\begin{split}\mathrm{leaky\_relu}(x) = \begin{cases} x, & x \ge 0\\ \alpha x, & x < 0 \end{cases}\end{split}\]where \(\alpha\) =
negative_slope.- 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.negative_slope (
Union[Float[Array, ''], float], default:0.01) – Value that specifies the negative slope.
- Return type:
- Returns:
The result of applying the nonlinearity to the input features.