Implementing reinforcement learning
In this section, we will look at how to implement a simple reinforcement learning method. We will use OpenAI's open source toolkits, gym
and universe
, for this purpose. gym
is a software framework for developing and comparing different reinforcement learning algorithms. It supports environments for different games by Atari, board games, as well as classic control tasks. universe
on the other hand provides a wrapper on top of gym
with modules for client and server, where you can visualize the progress of a reinforcement learning system. To install these toolkits on a macbook, we do the following:
pip install gym brew install golang libjpeg-turbo pip install universe
Simple reinforcement learning example
In this section, we will implement a simple reinforcement learning example for a game of DuskDrive
:
- We will use
gym
game environment for this purpose anduniverse
Docker environment for running it:
import gym import universe env = gym.make('flashgames.DuskDrive...