Backpropagation, intuitively
Lecture by 3Blue1Brown

Backpropagation is how the gradient gets computed. Starting at the output, it works out how each weight, bias and earlier activation should change to reduce the cost for one example, then averages those wishes across many examples.
Key concepts
Tap a card to reveal its meaning.
Study notes
Highlight any sentence to ask Sage about it.
What one example wants
Suppose the network sees an image of a 2. The output neuron for 2 should be pushed up and the others pushed down, and the size of each nudge should be proportional to how far each output is from its target.
Three ways to change an activation
A neuron's activation depends on a weighted sum plus a bias, so to increase it you can increase the bias, increase the weights, or change the activations in the previous layer. Weights attached to bright neurons in the previous layer have the biggest effect, which echoes the saying that neurons that fire together wire together.
Propagating backward
The previous layer's activations cannot be changed directly, but every output neuron has its own wishes for them. Adding those wishes together gives a list of desired changes for the second-to-last layer. Apply the same reasoning to that layer, then to the one before it: this backward flow of desired changes is backpropagation.
From one example to all of them
One image's wishes would only make the network great at recognizing that image. Averaging the desired changes across all training examples gives the negative gradient of the cost. In practice the data is shuffled into mini-batches of around 100 examples, and each mini-batch provides a quick, approximate step. This is stochastic gradient descent: less precise steps, but far more of them.
Lesson quiz
Ready to prove it?
3 questions. Get 2 right to complete the lesson.
- +60 XP for passing
- +20 XP per correct answer
- +25 XP for a perfect score
You can take the quiz without an account, but your XP is only saved once you create an account.
Final lesson
This is the last lesson of Neural Networks, Demystified.
Pass the quiz in every lesson to complete the course and unlock its +150 XP bonus.