fn
dropout1d
→Tensordropout1d(x: Tensor, p: float = 0.5, training: bool = True)Channel-wise dropout for 1-D sequence / feature inputs.
Drops entire 1-D feature maps (channels) of an
tensor with probability p, scaling the survivors by
to keep the activation magnitude unbiased.
Standard per-element dropout is statistically weak when
applied within strongly-correlated feature maps (consecutive
positions in a sequence are highly correlated), so masking the
whole channel at once provides stronger regularisation in
1-D CNNs and temporal feature extractors.
Parameters
xTensorInput tensor, typically of shape .
pfloat= 0.5Channel-drop probability in (default
0.5).trainingbool= TrueWhen
False, returns x unchanged — identity at
inference time (default True).Returns
TensorSame shape and dtype as x.
Notes
For each batch element and channel , draw independently and apply
The scale ("inverted dropout") preserves so no rescaling is needed at inference.
Examples
>>> import lucid
>>> from lucid.nn.functional import dropout1d
>>> x = lucid.ones((2, 4, 5))
>>> y = dropout1d(x, p=0.5, training=True)