Your first experiment
Train your first car Create two different networks. Train them, save them, then see how they drive on the same road.
Walk me through it Cancel walkthrough
1 · Train Car 1 Traffic Jam · 1 layer · 8 neurons 100 seconds per practice drive · about 65 mph cruise
Train Car 1 Save as Car 1
2 · Build the sophisticated car Save your first car, then try 5 hidden layers with 10 neurons per layer on the same road.
Create Car 2 · 5 layers × 10 neurons Train Car 2 Save as Car 2
Pause training
Ready when you are. Training runs 10 practice batches and stops automatically. Each drive lasts up to 100 simulated seconds.
Comparison playback Start over Clears all saved cars, training, settings, and walkthrough progress for Driving School. Opens the first popup again.
Replay time 0s
Play / pause replay
Stop comparison Restart Return to driving
Playback speed
½× 1× 2× 4× 8× 16× 32× 64× 128×
Adjust model and practice settings
Hidden layers
0 — direct connections 1 hidden layer 2 hidden layers 3 hidden layers 4 hidden layers 5 hidden layers
Neurons per hidden layer 5 neurons 6 neurons 7 neurons 8 neurons 9 neurons 10 neurons
What the decision network knows
Full awareness — 39 inputs 360° rays + speed only
Repeatable starting seed
Changing layers, sensors, or seed starts a fresh brain. Sensor ablation affects the networks; the tracking and safety controller still uses road geometry and traffic. Same seed repeats the random sequence; more layers need not learn faster.
Practice road
1 · Empty road 2 · Follow a slower leader 3 · Pass a slower car 4 · Wait for a passing gap 5 · Light traffic 6 · Highway traffic 7 · Heavy traffic (2× highway) 8 · Traffic Jam (4× highway)
Changing roads keeps the brain and clears performance history. Each learner has its own copy of the road. Background vehicles now respond to that learner when following it. Other learners are shown as ghosts, not obstacles.
Learn from instructor examples
Adds lane and speed examples during traffic practice. Rare passing examples receive extra weight so they are not lost among cruising examples. Exams use the learned decisions and the same lane controller, with coaching off.
Practice / Run it duration
100 seconds 200 seconds 300 seconds
Fixed exam duration
100 seconds 200 seconds 300 seconds
Use short practice and longer exams to test endurance. Every driver must survive the selected duration; distance and crashes still matter. Changing duration keeps the brain. Longer runs take more time and memory.
Run fixed exam · 32 drivers
Test now for a baseline, then practice and test again. Exams do not change the weights.
Restore best exam brain Replay baseline / current
The first exam captures a baseline. Best means most completions, then most safe passes per minute, then distance, on the same road. Checkpoints last for this page session; Save brain preserves restored weights.
Detailed progress
Training mode
Training
Run it
More training and saved cars
Start practice
+1
+10
+50
+200
Train 60 + exam
Train passing course
Stop
Train passing course measures a highway baseline, then runs 120 coached updates: 20 passing, 20 waiting for gaps, 20 light traffic, and 60 highway / heavy traffic. It finishes with the same highway exam. Train 60 + exam practises only the selected road. Short practice runs are faster; use a longer exam to test endurance.
Saved brain
Slot 1 · empty Slot 2 · empty Slot 3 · empty
Name
Three save slots in this browser. The trained example has its own permanent place.
Try trained driver
Save to slot
Load slot
Rename slot
Clear slot
Start over
Try trained driver loads the tested five-layer example without changing saved brains. Saving keeps the weights in this browser,
so you can train now and come back to a driver that already knows how.
Start over throws away the driver you are training right now and
rolls fresh random weights — nothing at all carries across.
Clear slot deletes only the selected saved brain. Saved brains are local to this browser. Start over keeps all saved slots.
Learning settings
Learning rate 0.050
How far the weights move after each batch. Too small and
it never improves; too large and it lurches and forgets.
Cars per batch 32
Every car tries slightly different moves; the ones that
beat the average get their choices reinforced. More cars means a less
noisy gradient , which is the cheapest way to make learning faster.
Larger batches take more time per update; start with 32.
Credit horizon 0.985 · ~17s
Future rewards fade over this simulated time, regardless of run duration. At 0.985, the effective horizon is about 17 seconds. A learned value estimate and advantage trace help connect a lane change with the pass that follows. Longer episodes collect more experience; they do not extend this horizon.
Exploration 1.00
How randomly it picks. This anneals down on its
own as it learns — early exploration is useful, late it just crashes
cars that would have driven fine. Touching this slider takes over
manually.
Road settings
Traffic 12 veh/mi/lane
Traffic speed variation ±20%
Each background driver gets a steady preferred speed within this range of cruise speed: ±20% means 80–120%. Different speeds let gaps open between lanes. Cars still slow for vehicles ahead. In the following lesson, the range is around the slower leaders’ 65% cruise speed. Changing this keeps the brain and clears comparison results.
Cruise speed 65 mph
Traffic can move faster or slower than cruise. Sometimes there is
no gap and the only right answer is to lift off and wait . Set
traffic to zero to practise steering without obstacles.
Unnecessary braking cost 0.06
Small penalty for requesting a slower speed on clear road. Following nearby traffic is exempt. Brake lights show actual deceleration, including speed adjustment during follow requests.
How far it can see 260 ft
At 65 mph a 3-second following distance is about
290 ft . Too short and it only reacts once it is too late; too long
and everything looks equally urgent.
Urgency to get there 0.30
Costs points for leaving a safely available faster lane unused. When all passing gaps are blocked, matching the leader is accepted. This encourages useful progress without paying for tailgating.
Safe pass bonus 4.0
Paid once for each vehicle that started ahead and is cleared by two car lengths. Close or unsafe encounters do not earn a bonus. Re-passing the same car earns nothing. Zero compares learning without a passing bonus.
Keep an open mind 0.020
A small exploration incentive keeps the decision network from becoming certain too early. Exams always choose its most likely action.
Fear of the edge 1.00
A graded penalty for predicted road-edge danger. The lane controller tracks valid lane centers; collisions remain a failure.
Stay between the lines 1.10
A small cost for straddling a lane line — not for
sitting off-centre. This is deliberately small so crossing a line to avoid traffic is still worthwhile.
Pointless lane request cost 2.00
Charged for requesting a lane without a clear speed advantage. The controller rejects that request; it never initiates a change itself. Zero removes the training penalty but keeps this rule. Crossing a line during an accepted transition has no lane-line penalty.
Minimum gap 1.5 car lengths
Tailgating costs 1.00
The car is penalised for having less than this much clear
road ahead, steeply more the closer it gets. Set the cost to 0 and it
will happily tuck in behind bumpers, which is faster and exactly what a
bad driver does.
Lane discipline 0.00
Bonus for making progress near the center of a lane . It fades toward lane boundaries and at low speed. Forward progress remains the largest positive reward at the default settings; sitting still earns no center bonus.
Smoothness matters 0.50
A gentle cost for changes in heading. Small corrections are allowed; center-of-lane progress matters more than perfectly smooth steering.
More information
How it works
Learn when to pass, follow, and wait. Train two cars on Traffic Jam, then compare their driving.
The network reads 39 inputs , including surrounding traffic, relative speed, gap safety, and its committed target lane. These are simplified measurements, not camera vision.
Reward priorities: safe forward progress and completed safe passes. Each unique safe pass earns 4 points; a collision costs 60 and ends the drive. Unnecessary lane changes cost points.
The network chooses left / keep / right lane × cruise / follow every quarter-second. A controller smoothly reaches the requested center. It accepts lane changes only when they offer a clear speed advantage and a safe gap, and limits speed behind a leader. These rules run identically in practice and exams; they never initiate a pass. Centering, basic safety, and rejection of pointless changes are provided by the controller, not evidence of learning.
A separate value network learns future driving outcomes to improve credit assignment. The diagram shows the decision network. New v4 brains use different inputs and actions; older saved brains remain untouched.
Glowing nodes mean activity, not improvement. Gold connections flash when their weights change. The fixed exam tells you whether those changes actually helped.