Table of Contents
Shortcuts

# Dropout1d

class torch.nn.Dropout1d(p=0.5, inplace=False)

  Randomly zero out entire channels (a channel is a 1D feature map, e.g., the j j j-th channel of the i i i-th sample in the batched input is a 1D tensor input[i,j]\text{input}[i, j]input[i,j]). Each channel will be zeroed out independently on every forward call with probability `p` using samples from a Bernoulli distribution.

  Usually the input comes from `nn.Conv1d` modules.

  As described in the paper Efficient Object Localization Using Convolutional Networks , if adjacent pixels within feature maps are strongly correlated (as is normally the case in early convolution layers) then i.i.d. dropout will not regularize the activations and will otherwise just result in an effective learning rate decrease.

  In this case, `nn.Dropout1d()` will help promote independence between feature maps and should be used instead.

  Parameters:

    - p (float, optional) – probability of an element to be zero-ed.

    - inplace (bool, optional) – If set to `True`, will do this operation in-place

  Shape:

    - Input: (N,C,L)(N, C, L)(N,C,L) or (C,L)(C, L)(C,L).

    - Output: (N,C,L)(N, C, L)(N,C,L) or (C,L)(C, L)(C,L) (same shape as input).

  Examples:

      >>> m = nn.Dropout1d(p=0.2)
      >>> input = torch.randn(20, 16, 32)
      >>> output = m(input)

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.