Giter Site home page Giter Site logo

hw3-tester's Introduction

HW3 Tester

NOTE: We are using Python 3. Make sure you are too:

(hw3) $ python --version
Python 3.6.1 :: Continuum Analytics, Inc.

Installation:

You can run the testing script 3 different ways:

  1. 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
  1. Pip:
pip3 install numpy pydot networkx progressbar2 pygraphviz pymdptoolbox
# or
pip3 install -r requirements.txt

pyraphiz failing to install?

pygraphviz requires you to have the graphviz package installed on your OS. See this thread

  • Note that conda install graphviz and conda install python-graphviz are different. You probably want the latter if using conda
  1. 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

On windows using powershell:

docker build -t rldm/hw3-tester:v1 .
$WorkingDir = Convert-Path .
docker run --privileged=true --rm -v $WorkingDir\:/mnt/hw3-tester -it rldm/hw3-tester:v1 /bin/bash

If you run into permissions errors when the docker container is building, you might have to change the Dockerfile to run the pip command before it resets the user back to the non root user.

If you run the test script in the next section and it gives you trouble about pymdptoolbox not being there, rerun the pip command inside the container without using pip3, use pip instead.

Testing the script

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.

Tester raises an exception?

If, after installing everything successfully above, hw3_tester.py raises an exception that pydot cannot find graphviz libraries (something like 'Warning: Could not load ".../lib/graphviz/libgvplugin_pango.so.6" - file not found), try the following: conda install -c conda-forge xorg-libxrender xorg-libxpm

Help?

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)

hw3-tester's People

Contributors

mimoralea avatar jrouly avatar scribby182 avatar giladgressel avatar lauradhamilton avatar wollerman avatar mitchdraft avatar nicklarsen avatar amirziai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.