In this example, we will address the problem of an inverted pendulum swinging up—this is a classic problem in control theory. In this version of the problem, the pendulum starts in a random position, and the goal is to swing it up so that it stays upright. Torque limits prevent the agent from swinging the pendulum up directly. The following diagram shows the problem:
The problem is addressed using an environment available in the OpenAI Gym library (Pendulum-v0) with the help of the DDPG agent of the keras-rl library (DDPGAgent).
OpenAI Gym is a library that 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. For the moment, we will imitate...