Map 1 · Building and training a network · Step 6
Compute the gradients
How does each weight learn its share of the blame?
Key formula
Fact or figure
Backpropagation gets every gradient for about the cost of one extra forward pass, by reusing each layer's error signal.
Skip this step and…
Following only one path when a unit feeds several outputs: the gradient must sum over every path.
Digits example
For the dense digit network: at the softmax output, then back through and the ReLU derivatives.
Learn it
Taught in Section 7 (Backpropagation) of the course. The map follows the deep learning workflow, the order you build a model in; the course teaches in the order that is easiest to learn, so the numbers can jump.
- 7.1 The Chain Rule and Computational GraphsBackpropagation is the chain rule applied backwards through the network, reusing every intermediate result. The chain rule on a small graph, with numbers, and the two rules: multiply along a path, add across paths.
- 7.2 Backpropagation for a Single Sigmoid NeuronThe derivation you are most likely to be asked for: the gradient of mean squared error for one sigmoid neuron over a batch of examples, step by step, with a numerical example and the matrix form.
- 7.3 One Hidden Layer: Deriving Every GradientThe classic exam derivation: a network with one sigmoid hidden layer and a linear output, trained with squared error. Output-layer gradients, the hidden error signal, input-layer gradients, and a full numerical example.
- 7.4 Backpropagation in Matrix FormThe same algorithm for a whole batch at once: four steps, the shape of every matrix, the element-wise product, how the output error changes with the loss, and a complete NumPy implementation.
- 7.5 Multiple Paths and Deeper NetworksWhen a hidden unit feeds several outputs, its gradient is a sum over paths. A two-hidden-layer, two-output example, the general backward recursion, and how it explains vanishing gradients.
How it connects
Feeds into · Step 7
Update the weightsThe gradients feed the weight update
How do I turn gradients into a better network?
Builds on · Step 4
Choose the activationsEvery backprop step multiplies by the activation derivative
Which non-linearity in hidden layers, and which at the output?
Builds on · Step 5
Choose the output and lossThe loss sets the output error that backprop starts from
How do I measure how wrong the network is?
Builds on · Foundation
Notation, probability and jargonDerivations depend on clear index notation
; is example , not a power