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

pong_A2C might backward policy-loss to value net #60

Open
aminzakizebarjad opened this issue Jul 10, 2022 · 0 comments
Open

pong_A2C might backward policy-loss to value net #60

aminzakizebarjad opened this issue Jul 10, 2022 · 0 comments

Comments

@aminzakizebarjad
Copy link

aminzakizebarjad commented Jul 10, 2022

I was reviewing the this code, then I thought that it is possible that the policy loss might impact on value branch net.
If you take a look at line 143 which is adv_v = vals_ref_v - value_v.detach() that is computing advantage, the value_v is detached to prevent policy loss to impact on value net in the backward process, but if you consider computing vals_ref_v which is conducted by function unpack_batch, then you will find out at line 90 last_vals_v = net(last_states_v)[1] the value net is involved in computing the vals_ref_v.
In result I think that the line 143 must get changed from adv_v = vals_ref_v - value_v.detach() to adv_v = (vals_ref_v - value_v).detach()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant