Q-learning for the mountain car problem in OpenAI gym

The mountain car is a standard testing problem in the domain of reinforcement learning. It consists of an under-powered car, which has to drive up a steep hill to the flag point as shown in the following diagram:

The catch here is that gravity is stronger than the car's engine, so even at full throttle the car cannot accelerate up that steep slope. Therefore, the car has to make use of the potential energy by driving in reverse, in the opposite direction and then utilize that to reach the flag point at the top right.

Here, state space is continuous and is defined by two points: position ...

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.