Cartpole - Introduction to Reinforcement Learning (DQN - Deep Q-Learning)

Solving OpenAI Gym Environment

Greg Surma
6 min readSep 26, 2018

In today’s article, I am going to introduce you to the hot topic of Reinforcement Learning. After this post, you will be able to create an agent that is capable of learning through trial and error and ultimately solving the cartpole problem.

Before and after training / Before and after reading this article

Table of Contents

Cartpole Problem

Cartpole - known also as an Inverted Pendulum is a pendulum with a center of gravity above its pivot point. It’s unstable, but can be controlled by moving the pivot point under the center of mass. The goal is to keep the cartpole balanced by applying appropriate forces to a pivot point.

Cartpole schematic drawing
  • Violet square indicates a pivot point
  • Red and green arrows…

--

--