The Keras reinforcement learning framework
At this point, we should have just enough background to start building a deep Q network, but there's still a pretty big hurdle we need to overcome.
Implementing an agent that utilizes deep reinforcement learning can be quite a challenge, however the Keras-RL library originally authored by Matthias Plappert makes it much easier. I'll be using his library to power the agents presented in this chapter.
Of course, our agent can't have much fun without an environment. I'll be using the OpenAI gym, which provides many environments, complete with states and reward functions, that we can easily use to build worlds for our agents to explore.
Installing Keras-RL
Keras-RL can be installed by pip. However, I recommend installing it from the project GitHub repo, as the code might be slightly newer. To do so, simply clone the repo and run python setup.py install
as follows:
git clone https://github.com/matthiasplappert/keras-rl.git cd keras-rl python setup.py install...