One bundle of glowing lines becomes a loss landscape, a neural network, a rolling optimizer and a dense network to show how back-propagation teaches a network
Every picture in this Jig is drawn by the same 640 glowing threads. Watch them twist and reshape to show how a neural network learns from its mistakes. The trick is called back-propagation.
Drag empty space to turn the drawing. Scroll or pinch to zoom.
Imagine every setting of a network's knobs, called weights, spread out like a map. The height above each spot is the loss: how wrong the network is with those settings. Learning means finding the lowest valley.
Real networks have millions of weights, so their landscape has millions of directions. This is a two-knob cartoon of it.
A neural network is layers of simple units joined by connections of adjustable strength. A guess flows forward, layer by layer, from left to right. At the end, the loss neuron measures how far the guess was from the right answer.
Back-propagation sends the error backward from the loss through every layer. A maths rule called the chain rule lets each connection work out how much it added to the mistake. Orange means turn this weight down; blue means turn it up.
One backward pass costs about as much as one forward pass, however many connections there are.
The gradient is the slope under the ball, and it points uphill. The optimizer, the part that changes the weights, steps the other way, like a ball rolling into a valley. Momentum, the speed it has built up, carries it over small bumps until it settles in a minimum. Drag on the landscape to drop the ball somewhere new.
Start it in the small hollow on the left and it can get stuck there: a local minimum.
Real networks are far denser, but they learn the same way: guess forward, send the blame backward, nudge every weight a little, and repeat. A 1986 paper by Rumelhart, Hinton and Williams made this method famous.
A small network that reads handwritten digits has 13,002 weights and biases. Large modern ones have billions.