Giter VIP home page Giter VIP logo

dqn's Introduction

DQN

DDQN CarRacing

This is a basic implementation of Deep Q Learning. We have implemented linear and convolutional DQN and DDQN models, with DQN and double DQN algorithms

Next steps:

  • Model trained on Atari games
  • Prioritized Experience Replay

To run

To begin, setup OpenAI gym and install the packages in requirements.txt.

We have an example script which trains a model on the CartPoleSwingUp environment (this requires gym <= 0.9.4). Run python -m examples.cartpoleswingup_linear in the top-level directory.

(To run Box2D environments, I used this Docker container - check it out if you are also having problems installing Gym)

Results

The best models trained on each env are present in results/models/. There you will find the saved pytorch model as a .pth file and a graph comparing the reward per episode against random play.

Linear models

Model Env Score
DQN CartPole-v1 500
DQN CartPoleSwingUp* 872 +/- 3

You can see how dependant the linear model is on various hyperparameters in the following graph

DQN linear investigation

*Note: While we can train high-performing models on CartPoleSwingUp, these are very unstable, even when training for millions of frames and with a large (100000) capacity memory. It is not clear why this is the case.

Conv model

Model Env Score

DQN_CartPoleSwingUp_Example

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.