Giter VIP home page Giter VIP logo

dqn's Introduction

Info

This project implements the DQN reinforcement learning agent similar to Human-level control through deep reinforcement learning

(See also David Silvers RL course lecture 6. This stuff is clearly and shortly explained in 1h15min onwards)

The agent is applied to the Open AI gym's 2d-car-racing environment

The structure of the q-network differs from the original paper. In particular, the network here is much smaller and can be easily trained without GPU. (It's easy to specify any other structures as well)

The agent learns to drive the car from pixels in a few hours and doesn't need any hand-crafted features. There are some minor environment specific tweaks for the car-racing but the base-agent doesn't know about car-racing.

Pre-trained agent

The checkpoint provided in the repo used the default parameters specified in the runner/agent and 150000~ playing steps for learning.

The training took about 5h with CPU. This agent is playing in the above gif and in this video: https://youtu.be/CVZQOAlQib0

The agent sometimes cuts corners but other than that it can drive flawlessly for minutes. There are some occasional mistakes though.

Running instuctions

Just clone the repo and use car_runner_main.py . The settings are specified in the beginning of the runner.

You can either train from scratch or load the existing checkpoint from this repo and see the agent driving somewhat properly right away. Or you can train the provided checkpoint more.

Requirements

  • Python 3.5 (will not work with python 2)
  • OpenAI Gym (the car-racing environment)
  • Tensorflow 1.0.0
  • numpy
  • scikit-image

dqn's People

Contributors

pekaalto avatar

Watchers

James Cloos 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.