speechbrain.nnet.dropout module¶
Library implementing dropout.
- Authors
Mirco Ravanelli 2020
Reference¶
- class speechbrain.nnet.dropout.Dropout2d(drop_rate, inplace=False)[source]¶
Bases:
torch.nn.modules.module.Module
This function implements dropout 2d. It randomly put zeros on entire channels.
- Parameters
Example
>>> drop = Dropout2d(drop_rate=0.5) >>> inputs = torch.rand(10, 50, 40) >>> output=drop(inputs) >>> output.shape torch.Size([10, 50, 40])
- forward(x)[source]¶
Applies dropout 2d to the input tensor.
- Parameters
x (torch.Tensor (batch, time, channel1, channel2)) – input to normalize. 4d tensors are expected.