GithubHelp home page GithubHelp logo

opocaj92 / mydqn Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 21 KB

A simple implementation of the Deep Q-Network used to play Atari games

Python 100.00%
deep-reinforcement-learning dqn theano lasagne openai-gym python convolutional-neural-networks atari-games

mydqn's Introduction

MyDQN

A simple implementation of the Deep Q-Network used to play Atari games

How it works

This is an implementation of the famous Deep Q-Network (DQN) proposed by Google DeepMind Labs to play Atari game from raw pixel, realized using Theano+Lasagne for the neural networks and OpenAI gym for the reinforcement learning environment. The code is structured as a library, aiming at being reusable for different applications than the two proposed examples (Pong and Breakout). The model architecture, the available parameters and their default settings, as well as the utility for the frame processing aim to make this implementation the more similar possible to the original one used in the paper (all these details are available in the paper appendix). The library is stored in the mydqn folder, containing:

  • AtariImageProcessor.py implements the preprocessing function for the game frames. They get resized, converted to greyscale, downsampled and then stacked together.
  • ReplayMemory.py implements the experience replay mechanism used by the DQN to break the statistichal dependency of consecutive samples.
  • EpsilonGreedyPolicy.py implements the exploratory policy followed when generating new samples.
  • ConvNN.py implements the convolutional neural network (CNN) used to represent both the target network and the Q-network of the DQN.
  • DQN.py joins together the other components to implement the DQN itself and its training process. Its many parameters should allow for flexibility and reusability in a variety of context.

The model itself is extremely memory consuming and CPU intensive (it works better on a modern GPU), so it is probably going to get killed by your system if you don't execute it on a powerful machine (ideally on a GPU). This project was done as an exercise and as a simple example of this model, and doesn't aim to good performances or great scalability.

Author

Castellini Jacopo

mydqn's People

Contributors

opocaj92 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

mydqn's Issues

frame skipping

Hello, Thanks for the code. I was checking your preprocess code, you seem to stack last 4 images . but if I am not wrong you have to take every 4th frame and stack 4 of those non skipped fames. you dont seem to have done that

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.