Backpropagation

20 min read

A network can have millions of weights, but it gets only one error number. Backpropagation is how the network finds which weights caused that error and by how much. In this lesson you do it by hand on a tiny network, then watch it work in a demo.

New words

Forward pass
Sending the input through the network, layer by layer, to get a prediction.
Loss
One number that tells how wrong the prediction is. Smaller is better.
Backward pass
Sending the error back through the network to find each weight's gradient.
Gradient
How much the loss changes if one weight goes up a little.
Chain rule
Multiply the small changes along a path to get the total change.
Autograd
A framework feature that finds all gradients for you automatically.

What you will learn

  1. Who is to blame for the error?
  2. The chain rule: a factory line
  3. A tiny network: the forward pass
  4. The backward pass: gradients by the chain rule
  5. Check the gradients, then update
  6. Forward, backward, update: repeat for every batch
  7. Try it: step through the network
  8. Do I write this myself? Autograd
  9. Common mistakes
  10. Explain it to a friend
  11. Key takeaways

10 quiz questions at the end.

Start this lesson

The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.

All lessons · Back to the roadmap