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

REINFORCE call in the decoder base class needs a detach call on top of the reward. #13

Open
prithv1 opened this issue Oct 10, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@prithv1
Copy link

prithv1 commented Oct 10, 2018

loss += -1 * log_prob * (reward * (self.mask[:, t].float()))

Following the paper, the above should be replaced by
loss += -1 * log_prob * (reward.detach() * (self.mask[:, t].float()))

Not having a .detach() on the reward here provides another source of gradients to the feature regression module in addition to the feature loss, the only difference being these gradients are scaled by the log-probs, which does not seem to mean anything intuitively.

@nirbhayjm nirbhayjm added the bug Something isn't working label Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants