Running in your browser
Watch software learn to steer.
Sixty vehicles start out knowing nothing, and learn to reach four waypoints without hitting anything. It is happening on your device, in this page, as you watch.
01 / Watch it
It starts from random numbers.
No language model, no downloaded model and no server. The steering comes from 1,324 numbers that begin as random noise. Your device is doing all of the learning, so a faster device learns faster. There are two ways of learning here, and you can switch between them.
The learning needs scripting switched on.
- Episode
- 1
- each one a new course for the same network
- Collided
- none yet
- in the last complete round
- Finished the course
- none yet
- reached all four waypoints in time
One bar for each round. Orange, from the top, is the share that collided. Blue, from the bottom, is the share that finished the course. The gap between them is the share that ran out of time. Learning well means the orange going away. When learning from experience, each bar is the last ten courses of a vehicle that never acts at random.
Every round is a new course, so nothing can be memorised: the vehicles have to learn to use their sensors. Progress is uneven, and some rounds go backwards. "Watch one trained earlier" shows a network that learned before you arrived, by this same code, so you can see where the learning leads without waiting. There is one for each way of learning. Those two, and the few vehicles the proving ground below starts with, are the only things on this page that were made in advance.
02 / The proving ground
The best so far, tested without a break.
Up to a hundred vehicles run together on course after course, each with ten waypoints and new obstacles. They are ranked by the share of courses they finish. A newcomer is on trial for its first ten rounds before it takes a place, and the lowest drop off. It starts with a few that were trained earlier. The best from your own learning above join as they appear.
The proving ground needs scripting switched on.
| Place | Vehicle | Finished | Collided | Waypoints of 10 | Rounds | Learned by | Its code |
|---|
A vehicle is nothing but its network's numbers, so its code is the whole vehicle: about 1,000 characters for one that evolved and about 2,700 for one that learned from experience. Copy a code and paste it here, on any device, and the same vehicle joins the board. The board is kept in your browser between visits and is never sent anywhere.
03 / How it works
Nobody writes the rules.
Not colliding is what matters most. A collision costs more than finishing the whole course earns, and passing close to something costs a little for every step it lasts.
What a vehicle senses
Twelve range sensors, each covering a twelfth of the circle around it. Each reports how close the nearest obstacle or wall is, and how fast that is changing. The vehicle is also told which way the next waypoint lies, roughly how far, and its own speed. Nothing else.
What it can do
Turn, speed up, slow down, stop and reverse. A small network turns what it senses into those choices. At the start the choices are random, and it usually collides within seconds.
Learning from experience
One network is shared by every vehicle. Each decision is remembered along with what happened next, and the network is corrected, a little at a time, towards what really happened. This is backpropagation, the method behind most modern machine learning, at a very small scale.
Learning by selection
Every vehicle has its own network. All of them run the same course, the best few go through unchanged, and the rest of the next generation is bred from the better ones, mixing their numbers and nudging a few at random. This is a genetic algorithm.
Have a hard problem?
Describe what is slow, stuck or risky, and get an honest view of whether it can be fixed.
Your details are used only to reply to you. See the privacy notice.