April 2018
Intermediate to advanced
334 pages
10h 18m
English
This is about a gridworld environment in OpenAI gym called FrozenLake-v0, discussed in Chapter 2, Training Reinforcement Learning Agents Using OpenAI Gym. We implemented Q-learning and Q-network (which we will discuss in future chapters) to get the understanding of an OpenAI gym environment.
Now, let's try to implement value iteration to obtain the utility value of each state in the FrozenLake-v0 environment, using the following code:
# importing dependency librariesfrom __future__ import print_functionimport gymimport numpy as npimport time#Load the environmentenv = gym.make('FrozenLake-v0')s = env.reset()print(s)print()env.render()print()print(env.action_space) #number of actionsprint(env.observation_space) ...