In this chapter, you learned the basic concepts of Q-learning and Deep Q-learning, and how to use these techniques to control a mechanical system. To start with, an overview of how Segways work was addressed. It is an electric traction-transport vehicle for individual locomotion that can start, stop, and reverse, with simple movements of the passenger-driver body—a slight bend forward or backward, and making curves with the help of a knob on the left-hand side of the handlebar. To show how it works, an inverted pendulum model was implemented.
Then, the OpenAI Gym library was introduced, which helps us to implement algorithms based on reinforcement learning. It includes a growing collection of benchmark issues that expose a common interface, and a website where people can share their results and compare algorithm performance. We explored the different environments...