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.

../_images/e3x.nn.activations.leaky_relu_0_0.svg
Parameters:
Return type:

Union[Float[Array, '... 1 (max_degree+1)**2 num_features'], Float[Array, '... 2 (max_degree+1)**2 num_features']]

Returns:

The result of applying the nonlinearity to the input features.