Coder Social home page Coder Social logo

dqn's Introduction

Deep Q Network

An implementation of q algorithm of Reinforcement Learning.

Installation Dependencies:

  1. Python 3
  2. TensorFlow 1.0.1
  3. pygame
  4. gym

How to Run?

git clone https://github.com/lufficc/dqn.git
cd dqn
python run.py

Tricks for flappybird

Remove background image: remove-bg

clip useless part: clip

resize and using binary image: bin

decayed ε-greedy exploration, and when exploration, 0.95 probability to do nothing(because in flappy bird, most time wo do nothing). This is very important. It makes model converge in less than 2 hours.

def egreedy_action(self, state):
    #Exploration
    if random.random() <= self.epsilon:
        if random.random() < 0.95:
            action_index = 0
        else:
            action_index = 1
        # action_index = random.randint(0, self.num_actions - 1)
    else:
        #Exploitation
        action_index = self.action(state)
    if self.epsilon > self.final_epsilon:
        self.epsilon *= self.decay_factor
    return action_index

Thanks

  1. DeepLearningFlappyBird
  2. Guest Post (Part I): Demystifying Deep Reinforcement Learning
  3. UCL Course on RL
  4. A Painless Q-Learning Tutorial
  5. DQN 从入门到放弃1 DQN与增强学习

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.