-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement noise_shape keyword for Dropout layers #20058
Comments
@soumith I have a look at this feature request. If we decide to implement it, I'm happy to take this small task. |
i think this is worth doing, but the first step to hook it up to is F.dropout in nn/functional.py For example: inp = torch.randn(10, 3, 224, 224)
noise_shape = torch.Size([1, 3, 1, 1]) In here, the same random mask will be broadcasted to shape of |
I was curious to know if anyone picked this up? |
@visionscaper nope |
I'd like to pick this up. |
Sounds great @shihongzhi! |
Hi! This is a papercut that we would also like to see solved. Is there anything we can do to speed this along? cc @cxhernandez |
馃殌 Feature
Tensorflow has a noise_shape keyword for tf.nn.dropout, which specifies which dimensions should have dropout masks calculated independently and which dimensions should have shared dropout masks. PyTorch should have a similar feature too.
Motivation
This is a very useful feature to have (for example, if we process the same example multiple times, we may want to tie dropout masks for each time we see that example), and while easy to implement independently, would be good to have common functionality for.
Pitch
Include extra kwarg to torch.nn.Dropout called
noise_shape
, with the same functionality as tf.nn.dropout.Alternatives
Fairly easy to implement independently, but would save hassle for many people if there was a core implementation.
The text was updated successfully, but these errors were encountered: