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

Potential error in training loop #46

Closed
sholtoarmstrong-iot opened this issue Nov 24, 2020 · 0 comments
Closed

Potential error in training loop #46

sholtoarmstrong-iot opened this issue Nov 24, 2020 · 0 comments

Comments

@sholtoarmstrong-iot
Copy link

In line train.py:100, The "loss.backward()" inside the sub_iter loop. However in line train.py:68 the "optimizer.zero_grad()" is applied outside the loop.

I am not sure if this is intended as to my knowledge the zero grad should be done between each backwards operation? This means the zero_grad should either be inside the sub_iter loop or the loss.backwards() should be replaced with a batch_loss.backwards() outside of the loop.

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