In [1]:
import sys
if "../" not in sys.path:
  sys.path.append("../")

import matplotlib
%matplotlib inline
matplotlib.style.use('ggplot')

from envs.windy_gridworld import WindyGridworldEnv
from utils import plotting

from sarsa import sarsa

# for auto-reloading external modules
# see http://stackoverflow.com/questions/1907993/autoreload-of-modules-in-ipython
%load_ext autoreload
%autoreload 2

In [2]:
env = WindyGridworldEnv()

In [3]:
Q, stats = sarsa(env, 200)

In [4]:
plotting.plot_episode_stats(stats)


Out[4]:
(<matplotlib.figure.Figure at 0x10480fd30>,
 <matplotlib.figure.Figure at 0x10e7e8320>,
 <matplotlib.figure.Figure at 0x10e8c7b00>)