e3x.nn.activations.relu6

e3x.nn.activations.relu6(x)[source]

Rectified Linear Unit 6 activation function.

Computes the gated linear activation with:

\[\mathrm{gate}(x) = \min\left(\max(\mathrm{sgn}\ x, 0), \frac{6}{x}\right)\]

For scalar inputs, this is equivalent to:

\[\mathrm{relu6}(x) = \min(\max(x, 0), 6)\]
../_images/e3x.nn.activations.relu6_0_0.svg
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:

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.