e3x.nn.activations.elu

e3x.nn.activations.elu(x, alpha=1.0)[source]

Exponential linear unit activation function.

Computes the gated linear activation with:

\[\begin{split}\mathrm{gate}(x) = \begin{cases} 1, & x > 0\\ \frac{\alpha}{x} \left(\exp(x) - 1\right), & x \le 0 \end{cases}\end{split}\]

For scalar inputs, this is equivalent to:

\[\begin{split}\mathrm{elu}(x) = \begin{cases} x, & x > 0\\ \alpha \left(\exp(x) - 1\right), & x \le 0 \end{cases}\end{split}\]
../_images/e3x.nn.activations.elu_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.