← Back to the lesson

How a neural network learns, one nudge at a time

Guess, check the error, nudge every weight a little. Then do it again. Slow it right down and watch one round.

Interactive 3D drawing of a small neural network: tanks for neurons, dials for weights, dots for signals

This is the text version. With JavaScript on, it’s a 3D drawing you can play, slow down and turn.

Step by step

  1. Forward. Three clues about one practice clip go in on the left. Each pipe has a dial, the weight, that says how much that clue counts. The middle neurons add up what reaches them and fire; the last neuron gives a guess: how likely this clip is a jump shot.
  2. Compare. The guess goes next to the right answer, which a person tagged ahead of time. The gap between them is the error. Early on the dials are random, so the first guesses are poor, close to 50-50.
  3. Back. The error runs backward through the pipes, layer by layer. On the way it works out, for every dial, which way to turn it to make this guess less wrong. That backward pass is called backpropagation.
  4. Nudge. Every dial turns a small step in its direction, all at once. Then the next clip comes in. Turn the step size way down and learning crawls. Turn it way up and the guesses overshoot and flip back and forth.

From the lesson

How do millions of weights end up set correctly?

By being wrong a million times and slightly less wrong each time. Guess, measure the error, nudge every weight toward less error, repeat. No one sets them. They settle. Felix’s random-guessing plan would still be running when the sun burns out.

Lesson 20.3: Hotter, Colder

More 3D drawings

All Data to AI lessons · See it in 3D