Welcome to the chapter on Reinforcement Learning. In the previous chapters till now, you have worked on solving supervised learning problems. In this chapter, we will learn to build and train a Deep Reinforcement Learning model capable of playing games.
We will do this with something called Deep Q Learning and Deep Sarsa Learning. The idea is that we will build a deep learning model also called an agent in reinforcement learning terms, that interacts with the game environment and learns how to play the game while maximizing rewards after several attempts at playing.
For the purpose of this chapter, we will be using the Cart-Pole game from Open Gym AI.
What we'll learn in this chapter is:
- How to interact with Gym toolkit
- What is Q learning and SARSA Learning
- Code the RL model and define hyperparameters
- Build and understand the training loop
- Test the model
It would be better if you implement the code snippets as you go along this chapter either in a jupyter notebook or any source code editor. This will make it easier for you to follow along as well as understand what each part of the code does.
All the python files and the jupyter notebooks for this chapter can be found here https://github.com/PacktPublishing/Python-Deep-Learning-Projects/tree/master/Chapter%2015