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

WeightDrop in evaluation mode #2

Closed
svengiegerich opened this issue Jun 4, 2021 · 1 comment
Closed

WeightDrop in evaluation mode #2

svengiegerich opened this issue Jun 4, 2021 · 1 comment

Comments

@svengiegerich
Copy link

Hej Katerina, first thanks for this nice adaption! Helped me a lot to use the AWD-LSTM for my own code.
Not sure if you are still using this repo, but for everybody how comes along maybe this is helpful:

For DropConnect set_weights in WeightDropout.py faces an issue in newer (?) Pytorch versions, because torch.nn.functional.dropout returns a tensor during training but a parameter during evaluation. Adding (*) should fix the bug.

if not self.training: # (*)
    w = w.data

setattr(self.module, name_w, w)

For more infos, see salesforce/awd-lstm-lm#79.

@mourga
Copy link
Owner

mourga commented Aug 16, 2021

Hey @svengiegerich thanks for the suggestion! I don't use the code anymore, so it'll be useful for people that work on this!

@mourga mourga closed this as completed Aug 16, 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

2 participants