Deep-Q-Learning-Paper-To-Code icon indicating copy to clipboard operation
Deep-Q-Learning-Paper-To-Code copied to clipboard

No gradient required for q_target calculation

Open Kaustubh-Khedkar opened this issue 3 years ago • 0 comments

Hi @philtabor, There is a possible bug in the dqn_agent.py file at line 93:

q_target = rewards + self.gamma*q_next

needs to be replaced with:

with torch.no_grad():
      q_target = rewards + self.gamma*q_next

This issue is also raised in https://github.com/philtabor/Deep-Q-Learning-Paper-To-Code/issues/9#issue-723686152

Could you please take a look?

Kaustubh-Khedkar avatar Jun 01 '22 21:06 Kaustubh-Khedkar