PacktPublishing / Deep-Reinforcement-Learning-Hands-On

Hands-on Deep Reinforcement Learning, published by Packt
MIT License
2.84k stars 1.29k forks source link

Update 02_dqn_pong.py #82

Open varenyamBakshi opened 4 years ago

varenyamBakshi commented 4 years ago

As uint8 is depreciated in later versions of pytorch, so instead use torch.bool for indexing the next_state_values. Using uint8 generates a user warning. Also actions_v tensor should be of dtype=torch.int64 to use the gather() .

varenyamBakshi commented 4 years ago

Also sir, I would like to thank you for writing such a great book. It is really helpful for me as you have beautifully combined the theoretical aspects with practical implementation. Hats off to you.

Shmuma commented 4 years ago

Hi!

First of all, thanks a lot for the pull request and book's feedback!

I propose not to merge your change it into the master branch, but rather create separate branch to port examples to the latest pytorch. This will keep compatibility with the book, but give users the flexibility to use the recent pytorch.

varenyamBakshi commented 4 years ago

yeah sure sir. Thanks a lot for responding. Looking forward to contribute to your book,