https://github.com/Kautenja/playing-mario-with-deep-reinforcement-learning
An implementation of (Double/Dueling) Deep-Q Learning to play Super Mario Bros.
https://github.com/Kautenja/playing-mario-with-deep-reinforcement-learning
atari2600 deep-reinforcement-learning double-dqn dqn dueling-dqn super-mario-bros tetris
Last synced: 6 months ago
JSON representation
An implementation of (Double/Dueling) Deep-Q Learning to play Super Mario Bros.
- Host: GitHub
- URL: https://github.com/Kautenja/playing-mario-with-deep-reinforcement-learning
- Owner: Kautenja
- License: mit
- Created: 2018-01-25T18:38:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-03T22:47:42.000Z (about 4 years ago)
- Last Synced: 2024-12-02T08:19:26.470Z (6 months ago)
- Topics: atari2600, deep-reinforcement-learning, double-dqn, dqn, dueling-dqn, super-mario-bros, tetris
- Language: Jupyter Notebook
- Homepage:
- Size: 3.91 GB
- Stars: 70
- Watchers: 7
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Playing Super Mario Bros. With Deep Reinforcement Learning
[](https://travis-ci.com/Kautenja/playing-mario-with-deep-reinforcement-learning)
Using (Double/Dueling) Deep-Q Networks to play Super Mario Bros.

# Installation
## `virtualenv`
Use `virtualenv` to contain the Python environment to a single local
installation of python3:#### Setup
To setup the virtual environment:
```shell
virtualenv -p python3 .env
source .env/bin/activate
```When you've concluded the session:
```shell
deactivate
```## Dependencies
[requirements.txt](requirements.txt) lists the Python dependencies for the
project with frozen versions. To install dependencies:```shell
python -m pip install -r requirements.txt
```**NOTE** if you're NOT using `virtualenv`, ensure that `python` aliases
python3; python2 is not supported.# Usage
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:```shell
python . -h
```## Test Cases
To execute the `unittest` suite for the project run:
```shell
python -m unittest discover .
```## Random Agent
To play games with an agent that makes random decisions:
```shell
python . -m random -e
```- `` is the ID of the environment to play randomly.
### Example
For instance, to play a random agent on Pong:
```shell
python . -m random -e Pong-v0
```## Training A Deep-Q Agent
To train a Deep-Q agent to play a game:
```shell
python . -m train -e
```- `` is the ID of the environment to train on.
### Example
For instance, to train a Deep-Q agent on Pong:
```shell
python . -m train -e Pong-v0
```## Playing With A Trained Agent
To run a trained Deep-Q agent on validation games:
```shell
python . -m play -o
```- `` is a directory containing a `weights.h5` file from a
training session### Example
For instance, to play a Deep-Q agent on Pong:
```shell
python . -m play -e results/Pong-v0/DeepQAgent/2018-06-07_09-24
```