Understanding the CartPole simulated environment

CartPole is an environment that can be used to train a robot to stay in balance—if it carries something and wants to keep it put while moving around. Due to the scope of this chapter, we'll only build models that work in the simulated CartPole environment, but the model and how it's built and trained can certainly be applied to a real physical environment similar to CartPole.

In the CartPole environment, a pole is attached to a cart, which moves horizontally along a track. You can take an action of 1 (accelerating right) or 0 (accelerating left) to the cart. The pole starts upright, and the goal is to prevent it from falling over. A reward of 1 is provided for every time step that the pole ...

Get Intelligent Mobile Projects 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.