alpha_dropout
→Tensoralpha_dropout(x: Tensor, p: float = 0.5, training: bool = True, inplace: bool = False)Alpha dropout — variance-preserving dropout for SELU networks.
Designed to be paired with the SELU activation (Klambauer et al. 2017 "Self-Normalizing Neural Networks"). Standard dropout breaks the carefully-tuned zero-mean / unit-variance propagation that makes SELU networks self-normalising; alpha dropout fixes this by replacing dropped activations with the SELU saturation value (rather than zero), then applying an affine rescaling chosen so that the post-dropout activations again have zero mean and unit variance.
Parameters
xTensorpfloat= 0.50.5).trainingbool= TrueFalse, identity (default True).inplacebool= FalseFalse).Returns
TensorSame shape and dtype as x.
Notes
With keep probability , each element is independently set to its original value (with probability ) or to (with probability ). The result is then affine-transformed:
chosen so that and when the input has zero mean and unit variance.
Examples
>>> import lucid
>>> from lucid.nn.functional import alpha_dropout
>>> x = lucid.randn(8)
>>> y = alpha_dropout(x, p=0.1, training=True)