fn
selu
→Tensorselu(x: Tensor, inplace: bool = False)Scaled exponential linear unit activation.
Self-normalising activation from Klambauer et al. (2017): when used in a fully-connected network with LeCun-normal initialised weights, the fixed scale and slope drive the activations toward zero-mean, unit-variance fixed points without the need for explicit batch / layer normalisation.
Parameters
xTensorInput tensor of any shape; activation is element-wise.
inplacebool= FalseAccepted for API compatibility; currently ignored.
Returns
TensorActivated tensor with the same shape as x.
Notes
with the (non-tunable) constants
chosen so that the activation has a zero-mean unit-variance attractor
fixed point. Pair with alpha_dropout and LeCun-normal weight init
to retain the self-normalising property.
Examples
>>> import lucid
>>> from lucid.nn.functional import selu
>>> x = lucid.tensor([-1.0, 0.0, 1.0])
>>> selu(x)
Tensor([-1.1113, 0.0000, 1.0507])