Skip to content
StackDecode
AI & ML Atlas
Neural NetworksalgorithmInteractive simulation

Backward Propagation

The backward half of training: errors flow from the output toward the input.

The idea

Starting from the loss, each layer receives the gradient from the layer above, uses it to compute its own weight gradients and passes a gradient on to the layer below. Frameworks automate this with automatic differentiation.

Watch it run

This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.

loss over epochs
  • predicts 0
  • predicts 1

Random weights: the network guesses about 50% everywhere, so the map is a washed-out mush. XOR needs a bent boundary.

epoch:
0
loss:
2.114
accuracy:
50%
1/15

Left: what the network predicts across the square. Right: the loss falling. The four ringed dots are XOR's corners.

Step by step

  1. 1Compute the output error.
  2. 2For each layer from the last to the first: compute the weight and bias gradients.
  3. 3Pass the gradient to the previous layer.
  4. 4Apply the optimiser's update.

Where it is used

The learning step of neural network training.

Watch out for

Memory use grows with depth because activations must be kept.

Related