Giter Site home page Giter Site logo

carracingrl_ddqn's Introduction

DDQN for Gym Openai CarRacing

Double Deep Q Network from Deep Mind's "Playing Atari with Deep Reinforcement Learning" dec 2013 with latest improvements from 2016 (target network periodical update and priorized experience replay). The algorithm is first validated on pendulum-v0 and then applied to the CarRacing-v0.

CarRacing-v0:

Actions: Steering: real value in [-1, 1] - Gas: real value in [0, 1] - Brake: real value in [0, 1]

Observations: STATE_W = 96 * STATE_H = 96 * 3 : RGB Image

Reward: +1000/N for every N tile on track else -0,1

- DDQN algorithm first benchmarked on pendulum-v0:

  • Pendulum_RL_DDQN_linearAct.py Pendulum-v0_DDQL Reward/Exploration
  • Pendulum_QL.py: simple QL

- Application of DDQN to CarRacing-v0:

  • CarConfig.py: Global configuration
  • CarRacing_RL_DDQN_linearAct.py: main file
  • brain_model.png: Keras plot of brain's CNN

DDQN_Brain_Model

  • SumTree.py: Class for priorized memory replay

- Policy calculation:

As the training time revealed excessive, a simpler approach was adopted: the steering policiy is learned by imitation learning; throttle and braking by reinforcement learning.

RLImitation folder:

Scatter plot of discretized actions function of the steering angle (note that the car accelerates mostly around 0°) Actions_Scatter

Result:

Three challenging discreet actions were chosen in order to prove that the algorithm learns a meaningful way to synchronize them: strong braking, fast acceleration or free wheeling (no action). As shown by the scatter plot and demo video, it manages to synchronize them with the steering policy: after some training time the car drives at decent speed, both on training and random tracks, does not immobilize anymore and is able to recover most of the time from off-road situations. Longer training, more data and smoother discrete actions would keep improving the performances.

Thanks to Jaara for the useful repo: https://github.com/jaara.

carracingrl_ddqn's People

Contributors

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