资源算法deeprl-snes

deeprl-snes

2020-02-13 | |  47 |   0 |   0

Playing SNES games with Deep Reinforcement Learning

Some tests for algorithms that learn how to play Super Nintendo and other retro games using Deep Reinforcement Learning methods.

Installation

First create a Conda environment using one of the provided environment file, either for CPU or GPU computation. GPU is highly recommended.

conda env create -f environment-gpu.yml

After that, activate the environment

source activate gym-retro-gpu

Finally you should install the ROMs for the games you want to try.

Training

The ideal hardware to train the player agent is to make use of a machine with a single GPU and a large number of CPUs. For instance, you could use a g3.4xlarge AWS instance. Be warned that training might take days!

Once you have decided on a game, you should desing a controller mapping for such game. This is to easen the learning process: only allow the agent to perform button combinations that make sense in the game. Just take a look at other examples in the games configuration file.

After this is done you can train on the game for a given level by running

python rllib.py GAME LEVEL --workers CPUS_ON_YOUR_MACHINE

Regular checkpoints will be saved under a folder in your ~/ray-results directory. You can visualize the training metrics by running

tensorboard --logdir=LOGDIR

You can then see the agent playing by running

python rllib.py  GAME LEVEL --test --checkpoint CHECKPOINTFILE

Movies of the playthrough can be recorded by adding the --makemovie argument.

Train examples

Gradius III (SNES)

python rllib.py GradiusIII-Snes Level1.Mode1.Shield

Donkey Kong Country (SNES)

python rllib.py DonkeyKongCountry-Snes 1Player.CongoJungle.JungleHijinks.Level1

Super Mario World (SNES)

python rllib.py SuperMarioWorld-Snes DonutPlains1

Sonic the Hedgehog (Genesis)

python rllib.py SonicTheHedgehog-Genesis GreenHillZone.Act1

Comix Zone (Genesis)

python rllib.py ComixZone-Genesis Episode1.Page1

Results

Work in progress! But do check my Twitter for updates.


上一篇:deeprl_practice_colab

下一篇:Var-QuantumCircuits-DeepRL

用户评价
全部评价

热门资源

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...