class Dropout(drop_prob=0.0, **kwargs)[源代码]#

Randomly sets input elements to zeros with the probability \(drop\_prob\) during training. Commonly used in large networks to prevent overfitting. Note that we perform dropout only during training, we also rescale(multiply) the output tensor by \(\frac{1}{1 - drop\_prob}\). During inference Dropout is equal to Identity.


drop_prob – The probability to drop (set to zero) each single element