Using (Double/Dueling) Deep-Q Networks to play Super Mario Bros.
Use virtualenv
to contain the Python environment to a single local
installation of python3:
To setup the virtual environment:
virtualenv -p python3 .env
source .env/bin/activate
When you've concluded the session:
deactivate
requirements.txt lists the Python dependencies for the project with frozen versions. To install dependencies:
python -m pip install -r requirements.txt
NOTE if you're NOT using virtualenv
, ensure that python
aliases
python3; python2 is not supported.
The following instructions assume you have a shell running at the top level directory of the project. For comprehensive documentation on command line options, run the following:
python . -h
To execute the unittest
suite for the project run:
python -m unittest discover .
To play games with an agent that makes random decisions:
python . -m random -e <environment ID>
<environment ID>
is the ID of the environment to play randomly.
For instance, to play a random agent on Pong:
python . -m random -e Pong-v0
To train a Deep-Q agent to play a game:
python . -m train -e <environment ID>
<environment ID>
is the ID of the environment to train on.
For instance, to train a Deep-Q agent on Pong:
python . -m train -e Pong-v0
To run a trained Deep-Q agent on validation games:
python . -m play -o <results directory>
<results directory>
is a directory containing aweights.h5
file from a training session
For instance, to play a Deep-Q agent on Pong:
python . -m play -e results/Pong-v0/DeepQAgent/2018-06-07_09-24