NOTE: We are using Python 3. Make sure you are too:
(hw3) $ python --version
Python 3.6.1 :: Continuum Analytics, Inc.
You can run the testing script 3 different ways:
- Conda:
# create conda environment and activate it
conda create -n hw3 python=3
source activate hw3
# install dependencies
conda install numpy pydot networkx progressbar2
pip install pymdptoolbox pygraphviz
# run the script to test the sample mdp
python hw3_tester.py -vvv -m sample.json -i -s
- Pip:
pip3 install numpy pydot networkx progressbar2 pygraphviz pymdptoolbox
pygraphviz
requires you to have the graphviz package installed on your OS.
See this thread
- Docker:
docker build -t rldm/hw3-tester:v1 .
docker run --privileged=true --rm \
-v $PWD:/mnt/hw3-tester \
-it rldm/hw3-tester:v1 /bin/bash
python hw3_tester.py -m sample.json -i -s -vvv
Output will show:
06/12/2017 01:57:32 AM - INFO:
06/12/2017 01:57:32 AM - INFO: mdp returned median number of iterations 2
number of iterations: 2
06/12/2017 01:57:32 AM - INFO: end of script
An image will be created on the same directory the json
file.
python hw3_tester.py -h
usage: hw3_tester.py [-h] [-v] [-vv] [-vvv] -m MDP_PATH [-c] [-i] [-s]
Reinforcement Learning and Decision Making, HW3 Tester
optional arguments:
-h, --help show this help message and exit
-v logging level set to ERROR
-vv logging level set to INFO
-vvv logging level set to DEBUG
-m MDP_PATH, --mdp MDP_PATH
Path to the MDP json file
-c, --check_only Flag to only check valid MDP on JSON file
-i, --iterations Calculate how many iterations PI takes to solve this
-s, --visualize Visualize MDP (export to png)