Giter VIP home page Giter VIP logo

dqn-car-game's Introduction

Car Game Hack using Deep Q Network

playing a self-made car game using deep Q network

About the Game


The goal of the game is to drive the car to the target(yellow circle); The player will fail if the car hits a wall or the car failed to reach the target within a certain time. There are four actions: accelerate, decelerate/reverse, steering right, and steering left.
The gaming is written using purely numpy and opencv, which means that rendering a frame is basically calculating a matrix base on the user's input and internal state hence it's freely efficient thanks to SIMD optimizations. You can play the game by execute python3 ./run_game.py(You need to have pygame installed to play the game. You can use arrow keys to drive the car.)

Some Implementation Details

  • We cannot use a single frame of the game as the game state since some internal state of the car like velocity can't be inferred from a single image. Therefore the game state is represented in three consecutive frames.
  • Some reward shaping techniques were used to improve the convergent speed since the original reward function was very sparse(1 when reached the target, 0 otherwise). While the algorithm still needs about 70 episodes to converge on the simplest game setup. In fact, DQN is not the best algorithm for this problem. Newer techniques like curiosity-driven learning might outperform DQN by a large margin on this sort of task

dqn-car-game's People

Contributors

guoqikai avatar

Watchers

 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.