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

To ensure the copy of gradients in chapter-11.ipynb/A3C #25

Open
MarginalCentrality opened this issue Apr 7, 2022 · 0 comments
Open

Comments

@MarginalCentrality
Copy link

In the optimize_model function of A3C, gradients from local model are copyed to shared model when “ shared_param.grad is None”. However, it seems that shared_param.grad would never be none after the first copy operation. Maybe we need to use "self.shared_value_optimizer.zero_grad(set_to_none=True)" to replace "self.shared_value_optimizer.zero_grad()". The same change should also be applied to “self.shared_policy_optimizer”.

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