Q-Learning on OpenAI gym
Before presenting another example, there appears to be a need for a suitable RL simulation environment. Otherwise, we can only run RL simulations on very simple problems like in the previous example. Fortunately, OpenAI created Gym, https://gym.openai.com.
The gym is a toolkit for developing and comparing RL algorithms. It works with most deep learning libraries, including Keras. The gym can be installed by running the following command:
$ sudo pip3 install gym
The gym has several environments where an RL algorithm can be tested against such as toy text, classic control, algorithmic, Atari, and 2D/3D robots. For example, FrozenLake-v0
(Figure 9.5.1) is a toy text environment similar to the simple deterministic world used in the Q-Learning in Python example. FrozenLake-v0
has 12 states. The state marked S is the starting state, F is the frozen part of the lake which is safe, H is the Hole state that should be avoided, and G is the Goal state where the frisbee...