Giter Site home page Giter Site logo

ashoknar / dqn-ddqn-on-space-invaders Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yilundu/dqn-ddqn-on-space-invaders

0.0 2.0 0.0 43.17 MB

Implementation of Double Deep Q Networks and Dueling Q Networks using Keras on Space Invaders using OpenAI Gym. Code can be easily generalized to other Atari games.

Python 100.00%

dqn-ddqn-on-space-invaders's Introduction

DQN-DDQN-on-Space-Invaders

Implementation of Double Deep Q Networks and Dueling Q Networks using Keras on Space Invaders using OpenAI Gym. Code can be easily generalized to other Atari games.

Prerequistes

You can install all the prerequistes for code use using

pip install -r requirements.txt

Instructions on Use

Details about the code are covered in the blog here

To run the code use

  python main.py

with arguments where arguments are given by

usage: main.py [-h] -n NETWORK -m MODE [-l LOAD] [-s SAVE] [-x] [-v]

Train and test different networks on Space Invaders

optional arguments:
  -h, --help            show this help message and exit
  -n NETWORK, --network NETWORK
                        Please specify the network you wish to use, either DQN
                        or DDQN
  -m MODE, --mode MODE  Please specify the mode you wish to run, either train
                        or test
  -l LOAD, --load LOAD  Please specify the file you wish to load weights
                        from(for example saved.h5)
  -s SAVE, --save SAVE  Specify folder to render simulation of network in
  -x, --statistics      Specify to calculate statistics of network(such as
                        average score on game)
  -v, --view            Display the network playing a game of space-invaders.
                        Is overriden by the -s command

For example, to test the pre-trained Double Deep Q Network architecture and view the network playing space invaders use

  python main.py -n DDQN -m test -l saved.h5 -v

or to train the Dueling Q Network architecture and then save the resulting video of the network playing in the test/ directory use

 python main.py -n DQN -m train -s test

Note that as the model is trained, every 10000 images, the program saves the network weights in either saved.h5 of duel_saved.h5 for DDQN and DQN respectively

dqn-ddqn-on-space-invaders's People

Contributors

ashoknar avatar yilundu avatar yilundu1 avatar

Watchers

 avatar  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.