Giter Club home page Giter Club logo

dqn's Introduction

Deep Q-Network in OpenAI Gym LunarLander environment

Reinforcement learning agent that learns to land a rocket optimally!

landing.gif

Motivation

I made this because I wanted to learn about deep reinforcement learning. I had already implemented Q-learning algorithm for Taxi environment and I wanted to tackle more challening environment. Lunar lander wasn't an easy environment but it seemed fun and I also like rockets!

Features

  • Off-policy model free Q-learning with deep neural network
  • Experience replay and separate target network for more stable learning
  • Able to solve LunarLander environment (LunarLander-v2 is considered "solved" when the agent obtains an average reward of at least 200 over 100 consecutive episodes.)
  • Uses Double DQN target for better performance

Technologies

  • Python 3.7
  • OpenAI Gym 0.17.3
  • Numpy 1.19.3
  • matplotlib 3.3.2
  • Tensorflow 1.15.4
  • tqdm 4.51.0
  • box2d 2.3.10

Usage

Install the requirements

pip install -r requirements.txt

Run main.py to start training, you will get a plot if you abort the training with Ctrl-C.

python main.py

Run example.py to see pre-trained agent in action.

python example.py

Additional info

Based on Deepmind's DQN paper: Mnih, Volodymyr, et al. "Human-level control through deep reinforcement learning." (2015)

Double DQN from: Van Hasselt, Hado, Arthur Guez, and David Silver. "Deep reinforcement learning with double q-learning." (2015)

Environment https://gym.openai.com/envs/LunarLander-v2/

TODO

  • DQN extensions
    • Prioritized experience replay
    • Dueling-DQN
  • Refactoring and better documentation

dqn's People

Contributors

dependabot[bot] avatar ranzuh avatar

Stargazers

 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.