Coder Social home page Coder Social logo

flming / dqn_flappy_bird Goto Github PK

View Code? Open in Web Editor NEW
6.0 0.0 3.0 154.04 MB

Using deep Q-networks to train an agent to play flappy bird.

Python 100.00%
dqn drl deep-reinforcement-learning flappybird tensorflow double-dqn target-network dueling-dqn

dqn_flappy_bird's Introduction

Deep Q-networks for flappy bird

Roadmap

  • Implement 2013 NIPS paper's DQN(with replay buffer)
  • Implement 2015 Nature paper's DQN(add the target network)
  • Implement double DQN
  • Implement Dueling DQN

Results

Each approach both played about 500k frame in my computer.

approach mean score highest score
2013NIPS 20.534 468
2015Nature 25.121 931
double_DQN 31.530 870
dueling_DQN 30.520 797

The score here cannot strictly represent the pros and cons of the algorithm.

You can download the trained model and logs

The change of mean Q value:

mean Q value

The change of score:

score

Requirements

  • tensorflow
  • pygame
  • opencv
pip install tensorflow pygame opencv-python

How to run

git clone https://github.com/FLming/DQN_flappy_bird.git
cd DQN_flappybird
python flappybird.py

change the approach just change the code in flappybird.py e.g.

from double_DQN import DeepQNetworks 
from DQN_Nature import DeepQNetworks

if you wanna see network architecture, the change of variables and scores.

tensorboard --logdir logs

if you wanna speed traning up, comment FPSCLOCK.tick(FPS) in wrapped_flappy_bird.py or add FPS

Reference

dqn_flappy_bird's People

Stargazers

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