
Last chance! 50% off unlimited learning
Sale ends in
Randomly zero out entire channels (a channel is a 3D feature map,
e.g., the
nn_dropout3d(p = 0.5, inplace = FALSE)
(float, optional): probability of an element to be zeroed.
(bool, optional): If set to TRUE
, will do this operation
in-place
Input:
Output:
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_conv2d 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_dropout3d will help promote independence between feature maps and should be used instead.
if (torch_is_installed()) {
m <- nn_dropout3d(p = 0.2)
input <- torch_randn(20, 16, 4, 32, 32)
output <- m(input)
}
Run the code above in your browser using DataLab