Reinforcement learning on Raspberry Pi

OpenAI Gym (https://gym.openai.com) is an open source Python toolkit that offers many simulated environments to help you develop, compare, and train reinforcement learning algorithms, so you don't have to buy all the sensors and train your robot in the real environment, which can be costly in both time and money. In this section, we'll show you how to develop, compare, and train different reinforcement learning models on Raspberry Pi using TensorFlow in an OpenAI Gym's simulated environment called CartPole (https://gym.openai.com/envs/CartPole-v0).

To install OpenAI Gym, run the following commands:

git clone https://github.com/openai/gym.gitcd gymsudo pip install -e .

You can verify that you have TensorFlow ...

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.