Deep Q-network for Cartpole problem in OpenAI gym

The Cartpole is one the simplest problems in an MDP environment, as shown in the following screenshot. It consist of a cart that moves in a horizontal axis with a pole anchored at the center of the cart, which rotates. The goal is to take actions in such a way that the pole remains near to vertical and not rotate down.

 A state in a cart pole environment is a 4-dimensional continuous space where each dimension is as follows:

  • x: It denotes the cart position (minimum = -2.4, maximum = 2.4)
  • x_dot: Denotes the cart velocity (minimum = -, maximum = )
  • theta: Shows the angle in radians (minimum = ...

Get Reinforcement Learning with TensorFlow now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.