Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaled embedded dropout mask #77

Closed
plpplp opened this issue Mar 3, 2021 · 1 comment
Closed

Scaled embedded dropout mask #77

plpplp opened this issue Mar 3, 2021 · 1 comment

Comments

@plpplp
Copy link

plpplp commented Mar 3, 2021

Hello,

why is the embedded dropout mask weighted by / (1 - dropout)?

mask = embed.weight.data.new().resize_((embed.weight.size(0), 1)).bernoulli_(1 - dropout).expand_as(embed.weight) / (1 - dropout)

I looked into the references in the corresponding paper but
Gal and Ghahramani (2016) are not using it and a Merity et al. (2018) are just stating that they do it. So I wonder what the idea behind the step is.

@plpplp
Copy link
Author

plpplp commented Mar 3, 2021

I found the answer. Scaling is to account for the change in magnitude of activations when dropout is applied and seems to be the standard way to do dropout.

@plpplp plpplp closed this as completed Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant