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

Backpropagation of dropout wrapper does not apply the mask #94

Open
TzuChieh opened this issue May 4, 2024 · 0 comments
Open

Backpropagation of dropout wrapper does not apply the mask #94

TzuChieh opened this issue May 4, 2024 · 0 comments

Comments

@TzuChieh
Copy link

TzuChieh commented May 4, 2024

Hi, I recently discovered this excellent repository for learning basic concepts in ML and noticed a potential problem in the implementation of dropout wrapper. In particular, this is the line of code I am confused about:

dLdy *= 1.0 / (1.0 - self.p)

Shouldn't the gradient from a later layer also apply the mask from the one used in forward()? Otherwise, dLdy will overestimate the true gradient after dividing by the probability 1.0 - self.p. Not sure this is an issue though as I am a beginner in ML.

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