Basic DQN
To get started, we will implement the same DQN method as in Chapter 6, Deep Q-Networks, but leveraging the high-level libraries described in Chapter 7, Higher-Level RL Libraries. This will make our code much more compact, which is good, as non-relevant details won't distract us from the method's logic.
At the same time, the purpose of this book is not to teach you how to use the existing libraries, but rather how to develop intuition about RL methods and, if necessary, implement everything from scratch. From my perspective, this is a much more valuable skill, as libraries come and go, but true understanding of the domain will allow you to quickly make sense of other people's code and apply it consciously.
In the basic DQN implementation, we have three modules:
Chapter08/lib/dqn_model.py
: the DQN neural network (NN), which is the same as Chapter 6, so I won't repeat itChapter08/lib/common.py
: common functions and declarations shared by...