Code Monkey home page Code Monkey logo

drl-carsimulator's Introduction

RL-car Simulator

Deep Reinforcement Learning (PPO) car simulator using unity engine and python.

Software

  • Windows10 (64bit)
  • Python 3.6
  • Anaconda3 5.0.1
  • Tensorflow 1.7.1

Hardware

CPU: Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz 2.30GHz

Languages

  • python
  • C#

Integrating the game (C#) with the alg (python)

using unity SDK ml-agents

RL algorithm used

PPO (Proximal Policy Optimization)

Description of folders

  • RL-3D-simulator is unity project for 3D car simulator,ready to be trained.
  • RL-Unity is unity project for 2D car simulator, ready to be trained.
  • UnityGame is unity project for the 2D game only without ml-agents setup and scripts.

How to Run this Project

  1. Download unitySDK repo https://github.com/Unity-Technologies/ml-agents
  2. Install the ml-agents as shown here https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Installation.md
  3. download this repo,then open the RL-3D-simulator unity project in unity and goto Assets->ml-agents->myCar->scene then click SampleScene.
  4. To train the game https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Training-ML-Agents.md

Simulator:

3D Model gif

3d_car_for_gif

Vector Observation states

Opponent cars position agent car position

Actions

The action of the vehicle is as follows.

  • Do nothing
  • move left
  • move right
  • move backward
  • move forward

Reward design

  • -1 when agent collide the opponent cars
  • -1 when agent collide with road boundaries
  • 0.5 when agent moves forward
  • 0.2 when agent moves right or left

Results

after 2 Hours training with PPO algorithm

Reward

Phase2_reward

Losses

Phase2_losses

drl-carsimulator's People

Contributors

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