
DeepTraffic is a gamified simulation of typical highway traffic - kiril-me
http://selfdrivingcars.mit.edu/deeptrafficjs/
======
jstanley
Why is everybody driving in random lanes? You should only go into the outer
lanes to overtake traffic, and then move back in once you've passed. It's not
just the law, it's a good idea...

EDIT: And for anyone looking for more info, this seems to be a more useful
page:
[http://selfdrivingcars.mit.edu/deeptraffic/](http://selfdrivingcars.mit.edu/deeptraffic/)

~~~
fatuna
As far as I know, it is common in Europe to only overtake on the outer lanes.
In the US however, there are no such rules.

It does seem like a good idea to me.

~~~
splike
The law exists in the US, but nobody bothers to follow it from my experience
driving there. People just seem to use the other lanes as more road.

~~~
virgil_disgr4ce
What I've never understood about this idea is that it suggests that speeding
must not be illegal in that passing lane. But that's not true. So then how
does a law for a passing lane work?

~~~
mulmen
I'm not sure where you get the suggestion that there is no speed limit in the
passing lane. We drive on the right so the safest place to pass is on the left
where the driver is. If everyone stays right as much as possible and faster
traffic (this does not imply speeding) can move left to pass then traffic
flows smoothly.

Where are you getting the impression that speeding is allowed anywhere?

~~~
nkurz
> Where are you getting the impression that speeding is allowed anywhere?

One reason is that in many places in the US, the normal traffic speed exceeds
the legal posted limit by 5-15 miles per hour. If the law requires a driver
travelling at the legal speed limit to stay out of the "passing lane" so that
other drivers can pass, this would imply that the law condones speeding, since
only a driver moving faster than the legal speed limit can make use of that
lane. If the law was not intended to encourage exceeding the speed limit, it
likely would have been written as something like "any driver moving less the
legal speed limit must avoid the passing lane".

Another reason is that some US states make exceptions to the normal speed
limit when passing another vehicle on a two lane road:
[http://blog.seattlepi.com/seattle911/2014/10/10/can-i-
speed-...](http://blog.seattlepi.com/seattle911/2014/10/10/can-i-speed-while-
passing/),
[http://www.mlive.com/news/index.ssf/2012/03/traffic_talk_com...](http://www.mlive.com/news/index.ssf/2012/03/traffic_talk_comments_should_t_1.html).
While one could argue that it's not "speeding" if it's not illegal, it's not
unreasonable to interpret such laws as "allowing speeding" to pass.

~~~
mulmen
> If the law requires a driver travelling at the legal speed limit to stay out
> of the "passing lane" so that other drivers can pass, this would imply that
> the law condones speeding, since only a driver moving faster than the legal
> speed limit can make use of that lane.

That's not how it works. The law is "stay right except to pass". This is true
regardless of speed. Speeding is still illegal in any lane. The "stay right"
rule is about not obstructing the flow of traffic, it has nothing to do with
the posted speed limit.

e: To clarify many people drive _below_ the speed limit, in this case it is
possible to pass them in a lane to the left without exceeding the speed limit.

~~~
nkurz
> The "stay right" rule is about not obstructing the flow of traffic

I agree, but the crux is whether one is prohibited from obstructing just the
legal flow of traffic, or from obstructing any flow of traffic. Different
states define this differently. Indiana, for example, recently reworded their
law to require you to allow any one to pass you even if they would be breaking
the law to do so: [http://www.nwitimes.com/news/local/govt-and-politics/new-
ind...](http://www.nwitimes.com/news/local/govt-and-politics/new-indiana-law-
move-over-slowpokes/article_154ca710-a423-583b-b7dc-00388ac0cabb.html). While
this doesn't make speeding legal, it strongly implies that drivers who wish to
illegally exceed the speed limit in Indiana have a right to do so.

~~~
mulmen
I disagree that the Indiana law implies a right to speed, it just says that
traffic should not be impeded. If you are going 65mph in a 65mph zone on a two
lane road and someone comes up behind you at 80mph and you move over to pass
as required by that law it's still entirely possible that they will be pulled
over after they pass you.

The law is about reducing the hazards on the road. Impeding traffic flow is
extremely dangerous, more so than most people seem to realize [2]. These laws
also apply in cases where the passed vehicle is traveling _below_ the speed
limit.

The "stay right" rule is about not obstructing traffic because doing so is
very dangerous. If that traffic is speeding then yes, they are also
technically in the wrong but it is important to also stay right and not create
an even more hazardous situation.

This also means the "cruise control pass" where one car slowly overtakes
another is also illegal if it is delaying anyone else from passing.

Washington State has a similar law [1] as does Idaho I believe.

[1]:
[http://app.leg.wa.gov/rcw/default.aspx?cite=46.61.427](http://app.leg.wa.gov/rcw/default.aspx?cite=46.61.427)

[2]:
[https://www.youtube.com/watch?v=4oqfodY2Lz0](https://www.youtube.com/watch?v=4oqfodY2Lz0)

~~~
nitrogen
Responding to a comment that was deleted while I typed (sorry for any
misformatting; copy/paste/edit is kind of difficult in the microscopic text
box on a phone):

 _Retric 6 minutes ago | parent | flag | favorite | on: DeepTraffic is a
gamified simulation of typical hi...

It's much safer for a few semi's to block all lanes while going the speed
limit than to let people pass at 80+MPH. So, moving to the right lane has
little to do with safety just enabling speeding. In heavy traffic police will
sometimes do this at below highway speeds which can create a huge net benefit.

Further, lane changes are dangerous and should be minimized._

It's hardly safe if the natural speed of traffic behind the semis is x+5 and
the semis are going x. Then you have a constantly growing number of cars
trying to fit in the same amount of space, and density seems way more
dangerous than speed.

I don't understand why some drivers feel the need to control every other
driver behind them. As other commenters have said, it is more dangerous (and
less efficient) to create a backup than to just let faster traffic pass,
regardless of the numbers printed on the signs.

It is not your job as a driver to police other drivers. Maybe your bald all
seasons on your cheap sedan can only go 55 in a 70 in the rain, but that other
car has rain tires and traction control that could handle 110, so they are
safe at 70 in a 70. Preventing them from passing is unsafe and deeply
impolite.

~~~
mulmen
I really believe we should have mandatory driver testing on a regular basis.
Say every 5 years for a skill test and a written test every year. Written test
could be through the mail and it could be funded by increased penalties on
speeding and impeding traffic flow.

I got my drivers license in Idaho then moved to Seattle years later.
Washington took one look at my Idaho license and handed me a Washington
license. There were no questions asked about traffic laws or anything.

This city has grown substantially in the last 10 years and it's starting to
show in the traffic. We have big backups but we aren't at capacity, drivers
are just very inefficient in their habits. Last year there was a push from the
DOT to encourage zipper merging to more efficiently use our roads. I try to
follow that advice but drivers aggressively prevent the merge at the merge
point, probably because it seems to them like I am "cutting" in line.

I think we could make big improvements just with some education. Self-driving
cars will help but making people better (even a little bit) will help. And if
human drivers follow the rules more reliably that has to make the self-driving
car's job easier during the long transition from all human to all AI
controlled.

------
djb_hackernews
I was able to get speeds of 71 MPH, now can anyone tell me exactly what I did
because my approach was just to randomly change values, train and run.

I read the documentation and watched the first video and read all of the
lecture slides but I haven't really grasped any of the concepts. Like, is 400
num_neurons a lot? Not a lot? Why would looking backward help at all? Why have
that as a variable? It suggests to increase the train_iterations from 10000.
Does that mean 15k, 100k, 1000k? Was that the point of the exercise, just to
get comfortable with making changes and running simulations or should I have
come away with a deeper understanding?

If anyone feels like they could teach me I'd be willing to pay $100 for a half
hour of your time, skype or Cambridge/Boston if you are local.

~~~
baking
I haven't played around with it much, but look at the layers of the network.
First layer is the inputs which is pretty much one for each input square. If
you want to be fairly optimal figure you need to look at 5 lanes total and at
least 10 squares ahead (and maybe a few behind if you need to get out of a
jam) so that's 50 inputs per frame but it is taking inputs from 4 frames so
that's 200+ inputs in the first layer (plus 15 for the actions for the last 3
frames).

The output actions are 5 so that is the size of the output layer.

You can change the number of nodes in the middle layer but you can also cut-
and-past that code to add additional layers.

I think you probably need at least two layers, the first to determine which
lanes are clear and the second for figuring out how to maneuver into the
desired lane.

With such a large network, training will take longer so stick with the default
iterations until you feel like you need more fine tuning.

~~~
baking
On second thought, I would say start with smaller models and work your way up.
More complicated models take much longer to train, and keep training them
until they plateau. Turn off the overlay and train on fast speed to get there
faster.

Once you are satisfied with a model, change one thing and see how much of an
improvement you get, but it is a time-consuming process. I have not fiddled
with any of the "opt." options yet.

------
gefh
From the source, for those who are wondering what 'fc' or 'relu' mean:

    
    
              case 'fc': this.layers.push(new global.FullyConnLayer(def)); break;
    
              case 'lrn': this.layers.push(new global.LocalResponseNormalizationLayer(def)); break;
    
              case 'dropout': this.layers.push(new global.DropoutLayer(def)); break;
    
              case 'input': this.layers.push(new global.InputLayer(def)); break;
    
              case 'softmax': this.layers.push(new global.SoftmaxLayer(def)); break;
    
              case 'regression': this.layers.push(new global.RegressionLayer(def)); break;
    
              case 'conv': this.layers.push(new global.ConvLayer(def)); break;
    
              case 'pool': this.layers.push(new global.PoolLayer(def)); break;
    
              case 'relu': this.layers.push(new global.ReluLayer(def)); break;
    
              case 'sigmoid': this.layers.push(new global.SigmoidLayer(def)); break;
    
              case 'tanh': this.layers.push(new global.TanhLayer(def)); break;
    
              case 'maxout': this.layers.push(new global.MaxoutLayer(def)); break;
    
              case 'svm': this.layers.push(new global.SVMLayer(def)); break;

------
rawnlq
I wonder how simulations like this transfer to the real world. For example if
you want to win in the real world you just start driving like a maniac. People
will very quickly get out of dodge.

Spoilers: I tried to encode this idea by setting the inputs to be just tall
enough to learn the safety system and wide enough to cover all lanes with no
forward visibility. This learns an aggressive lane switching algorithm that
lets you hit around ~70mph though not for the reason I thought. Also needed a
few more hidden units/layers to make it work.

~~~
indeed30
Yes, similar experiences here. It seems relatively easy to hit the 70mph mark
but it gets tough past that.

------
screwt
For self-driving cars, I'd much rather your code control _all_ the cars, not
just an individual.

Individualistic driving leads to worse overall performance for everyone. One
of the things I'm most looking forward to in an all-code-controlled driving
future is seeing efficient highway traffic moving fast and smoothly.

(And yes, clearly there's a long transition period where some cars are
controlled while others are still human-driven.)

~~~
jstanley
> I'd much rather your code control _all_ the cars, not just an individual.

That's not how the world works though. The only thing you can control is your
own actions. Trying to control other people's actions is a recipe for failure.

~~~
kuschku
> Trying to control other people's actions is a recipe for failure.

Trying to control other people’s actions is called a law.

------
czbond
Can someone help me understand - why is this in JS? [I'm asking seriously, not
trying to start a language troll-war]. I ask because I'm designing a system
that could use JS trained models (for wider company access) - yet I was
unaware of tools that can run models at scale using JS (i've seen more in
Python, R).

~~~
azdle
Because it's about teaching, not about getting the best possible performance.
JS based stuff is easy to get working, because it's just "install chrome, go
to <webpage>".

~~~
czbond
Fantastic I'm all about that. I wanted to make sure there hasn't been a leap
in language tools that I missed. Thanks.

------
raverbashing
8 lanes is easy

Try driving in 2 lanes with random people switching lanes in front of you,
people randomly blocking your lane to turn, etc, also make sure you get into
your destination on time

------
Chris2048
So, Is the idea that some autonomous cars could just drive around doing
nothing other than setting the pace?

