Watch a tiny brain learn to fly
A newborn neural network, about 3,400 weights, teaches itself to land a paper glider on the perch. It trains right here on your device, by trial and error, and the it expects is drawn on the chart.
A trained glider is flying the perch. Press Hatch to start from a blank brain.
Flight log
No updates yet.
What it expects
Waiting for the first flight.
Change the world
Drag the perch or the nest on the chart, or pick one here and use the arrow keys (0.5 m). Training keeps going and adapts.
Fly three attempts with the arrow keys or WASD. Your best score becomes a line on the flight log.
Settings
Keyboard shortcuts
P pauses or resumes training. F toggles Fast. H hatches a new brain. G toggles best guess. Arrow keys move the selected item when the chart is focused.
Brain library
Saved in this browser only. Export a file to keep or share a brain.
Inside the network
Hover or focus an input to see what it means. Brighter lines are bigger weights; filled units are active right now.
Guided lessons
What it intends
The picks actions; the predicts the future; keeps it trying new things.
How it's built
- Reinforcement learning from scratchMultilayer perceptrons, backpropagation, Adam and PPO with GAE, written in TypeScript with no ML library. Every gradient is checked against finite differences.
- Sixteen flights, one workerSixteen gliders train in a Web Worker while the page flies the newest policy at 60 fps. The same seed gives a bit-identical brain in Node and in your browser.
- Predictions you can seeThe petals are the probabilities of its six thrusters, the dashed line is the path it imagines, and the contour rings are its value function, traced by marching squares.
- Change the world, keep the brainMove the perch, draw walls, add wind or gates and watch it adapt. Worlds, rewards and even trained brains fit in a share link (int8 weights, deflated, under 6 KB).
- It predicts its own futureEach flight starts with a guess of the reward to come. The panel compares that guess with what actually happened.