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

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

from envs.cliff_walking import CliffWalkingEnv
from utils import plotting

from q_learning import q_learning

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

In [2]:
env = CliffWalkingEnv()

In [3]:
Q, stats = q_learning(env, 500)

In [4]:
plotting.plot_episode_stats(stats)


Out[4]:
(<matplotlib.figure.Figure at 0x10480fa20>,
 <matplotlib.figure.Figure at 0x10e749e48>,
 <matplotlib.figure.Figure at 0x10eebcf28>)