Code Monkey home page Code Monkey logo

deeptraffic's Introduction

DeepTraffic: MIT Deep Reinforcement Learning Competition

DeepTraffic - Visualization - Leaderboard - Documentation - Paper - MIT Deep Learning [ GitHub | Website ]

DeepTraffic is a deep reinforcement learning competition hosted as part of the MIT Deep Learning courses. The goal is to create a neural network that drives a vehicle (or multiple vehicles) as fast as possible through dense highway traffic. Top 10 submissions are listed on the leaderboard and you'll be able to visualize your submission in the following way:

DeepTraffic visualization

If you find the work useful in your research, please cite the DeepTraffic paper:

@inproceedings{fridman2018deeptraffic,
author = {Lex Fridman and Jack Terwilliger and Benedikt Jenik},
title = {DeepTraffic: Crowdsourced Hyperparameter Tuning of Deep Reinforcement Learning Systems for Multi-Agent Dense Traffic Navigation},
booktitle = {Neural Information Processing Systems (NIPS 2018) Deep Reinforcement Learning Workshop}
year = {2018},
url = {http://arxiv.org/abs/1801.02805},
doi = {10.5281/zenodo.2530457}
archivePrefix = {arXiv},
}

To get started right away, this repository provides a code snippet to insert into the code box on the DeepTraffic site. We'll add additional agents as the course progresses:

network_basic.js: A basic network that achieves ~66.8mph.

And now let's return to the problem of traffic:

Problem Statement: Traffic is Terrible

"Americans will put up with anything provided it doesn’t block traffic." - Dan Rather

"Traffic is soul-destroying." - Elon Musk

In the U.S. alone, we spend 6.9 billion hours sitting in traffic each year [1] — roughly 10,000 human lifetimes [2]. Autonomous vehicles will be able to alleviate part (but not all) of the problem. Already, they show promise in reducing phantom traffic jams [3,4].

We’ve designed DeepTraffic to let people (from beginners to experts) explore the design of motion planning algorithms for autonomous vehicles and to inspire the next generation of traffic engineering. We thank the thousands of competitors who have submitted solutions and are actively participating.

DeepTraffic Layout

DeepTraffic

The game page consists of four different areas:

  • On the left, you can find a real time simulation of the road with different display options.

  • On the upper half of the page, you can find (1) a coding area where you can change the design of the neural network which controls the agents and (2) some buttons for applying your changes, saving/loading, and making a submission.

  • Below the coding area, you can find (1) a graph showing a moving average of the center red car’s reward, (2) a visualization of the neural network activations, and (3) buttons for training and testing your network.

  • Between the simulated roadway and the graphs, you can find the current image of you vehicle and some options to customize it and create a visualization of your best submission.

The simulation area shows some basic information like the current speed of the car and the number of cars that have been passed since you opened the site. It also allows you to change the way the simulation is displayed. Display selection

DeepTraffic Simulation & Game

In short, DeepTraffic is a game in which you (a competitor) design your own motion planning algorithm in order to drive a vehicle as fast as possible through dense traffic.

Your algorithm will operate on a 7 lane highway. There are 20 vehicles on the road. Your algorithm controls some vehicles. The game controls the others.

Each autonomous agent runs a copy of your algorithm. Every 30 frames, your algorithm selects 1 of 5 actions:

  1. accelerate
  2. decelerate
  3. change into the left lane
  4. change in to the right lane
  5. do nothing, i.e. maintain speed in present lane.

Your algorithm will receive, as input, an occupancy grid, representing the free space around the agent. The value of unoccupied cells is set to 80mph. The value of occupied cells is set to the speed of the occupying vehicle. For example here's an occupancy grid (lanesSide = 1; patchesAhead=10):

learning input

There are a few quirks to DeepTraffic’s dynamics:

Safety System

Each vehicle has a safety system which prevents it from colliding with other vehicles. This has 2 implications for how you will design your algorithm. First, your algorithm does not need to consider collision avoidance. Second, your path will be overridden when the safety system is activated.

For example, here, the red car cannot accelerate or change into the right lane, because the collision avoidance system has detected vehicles in the way:

safety system

A vehicle that is 4 cells behind another will immediately slow to match the lead vehicle, regardless of what its algorithm tries to do. (see diagram above)

A vehicle driving beside another will be unable to change into its neighbor’s lane until there is a sufficient gap, regardless of what its algorithm tries to do. (see diagram above)

Multiple Agents

In version 2.0, the current version, you have the option to deploy a copy of your algorithm on 11 vehicles. You algorithm won’t do multi-agent planning, rather each vehicle makes a greedy choice. The challenge is to design an algorithm which does not get in its own way when controlling several vehicles.

Where the Highway Ends

DeepTraffic follows just one of the vehicles (the ego vehicle), so you’ll notice some of the vehicles fall off the highway when they drive slower or faster than the ego vehicle. What happens to these vehicles?

When vehicles fall off the road, they are replaced by new vehicles on the opposite end of the highway. When a vehicle is replaced, its speed & lane is chosen randomly.

Hyperparameters

To do well in DeepTraffic using DQN, you’ll have to choose good hyperparameters. This can be tricky because (1) the full hyperparameter space is rather large and (2) the bigger your network gets, the longer it takes to train which means you’ll explore less of the hyper-parameter space. Therefore, it helps to understand how changing the hyper-parameters will change performance prior to training.

parameters

Results

Progress

The plot below shows how the competition progressed over time:

progress

The Structure of Submissions

Below is a t-SNE plot, i.e. submissions originally represented in a vector space spanning patchesAhead, patchesBehind, l2_decay, layer_count, gamma, learning_rate, lanesSide, train_iterations are plotted in a 2 dimensional space which preserves the composition of neighboring points. The color of each dot corresponds to submissions score. An interesting feature of this plot is that several clusters emerge — competitors stumbled upon similar solutions.

tsne

Help and Documentation

See Documentation page for more details and hints and how to submit to the competition.

Team

References

deeptraffic's People

Contributors

0xflotus avatar lexfridman avatar pochoi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deeptraffic's Issues

Observation error?

Hi!

From simple investigation of observations passed to the neural network's input, I see very weird values passed having the following issues:

First of all, observation vector contains 0 for cells outside of the road and 1 if cell is not occupyed by other car (those values are not mentioned in arxiv paper).

Second, much more serious problem is related to situations with occupied cells. Ff the cell is occupied by other car, it doesn't have speed relative to the central car (as was stated in the paper), but rather has values between 0.018 and 0.27, regardless of relative speed of the other car.

Even if my car is constantly issuing decelerate action and all the cars are overtaking me at high speed, this number is positive and has the range above. For example, that's the small log of state vector I'm observing if lanesSide = 3, patchesAhead = 1, patchesBehind = 0, temporal_window = 0 (which gives me just 7 numbers for row in front of the car):

VM1698:71 (7) [1, 0.025997055518438162, 1, 1, 1, 1, 1]
VM1698:71 (7) [1, 1, 1, 1, 0.020270829044069006, 1, 1]
VM1698:71 (7) [1, 0.02407384558168598, 1, 1, 1, 1, 1]
VM1698:71 (7) [1, 1, 1, 1, 0.026940491870455902, 1, 1]
VM1698:71 (7) [1, 1, 1, 1, 1, 1, 1]
VM1698:71 (7) [1, 1, 1, 1, 1, 1, 0.02142199183294735]
VM1698:71 (7) [1, 1, 0.018471935100245227, 1, 1, 1, 1]

As I've said, those numbers stay positive regardless of relative speed, which looks like a bug and deviates from formula given in the paper.

Milehigh.world

At Milehigh.world, we’re pioneering a revolutionary software application that harnesses the power of deep learning to redefine music exploration in the tech world.

Picture a cutting-edge tool that transcends traditional boundaries, delving into the infinite realms of music with unparalleled precision and insight. Our software leverages state-of-the-art deep learning algorithms to unravel the complexities of musical composition, opening doors to endless creative possibilities.

With MileHigh.world, users immerse themselves in a world where technology meets innovation, where data-driven insights fuel artistic expression, and where the boundaries of music are continually pushed and expanded. Our software analyzes vast datasets of music, identifying patterns, trends, and hidden connections that lay the foundation for groundbreaking discoveries.

But MileHigh.world isn’t just about analysis—it’s about empowerment. Our software equips users with intuitive interfaces and powerful tools that enable them to become architects of sound, shaping and sculpting melodies with unprecedented control and precision. Whether you’re a seasoned programmer or a curious enthusiast, our software offers a playground for experimentation and discovery.

What sets MileHigh.world apart is our relentless pursuit of innovation and collaboration. We’re not just building a software application; we’re creating a community of like-minded individuals who share a passion for pushing the boundaries of technology and music. Through collaborative projects, shared insights, and ongoing research, we’re forging new pathways and redefining what’s possible in the world of music and technology.

Join us on a journey to the forefront of music exploration in the tech world. Together, let’s unlock the infinite possibilities of deep learning and pave the way for a future where creativity knows no bounds.

Basic Code

Thanks for the course. I am currently following it. I am new to AI. I want to take part in the competition. Is there some basic running code that I can take and start working on it? Sorry if it is not a relevant question.

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.