Backpropagation, One Edge at a Time
A tiny network with every forward value and every gradient shown on the graph.
Controls
Computational graph
Stage 1 / 7: forward through layer 1
Loss for this example: not yet computed — step forward to the output. Click any edge to inspect its weight and gradient below.
Training loss
0 gradient-descent steps taken so far (full-batch).
Gradient magnitude by layer
Mean |∂L/∂w| per weight matrix, this example — watch it shrink toward the input with sigmoid and depth.
Finite-difference check
Central-difference numerical gradient versus the analytic backprop gradient for every edge in one layer.
| edge | analytic ∂L/∂w | finite-difference | |difference| |
|---|---|---|---|
| unit 0 → unit 0 | 0 | 0 | 0 |
| unit 1 → unit 0 | -0.00160 | -0.00160 | 1.27e-12 |
| unit 0 → unit 1 | 0 | 0 | 0 |
| unit 1 → unit 1 | -0.00192 | -0.00192 | 1.45e-12 |
| unit 0 → unit 2 | 0 | 0 | 0 |
| unit 1 → unit 2 | 0.00650 | 0.00650 | 4.73e-12 |
Backpropagation is only the chain rule applied edge by edge through the graph: it produces every ∂L/∂w number shown above. It never decides how far to move a weight. That decision — subtract η times the gradient — is gradient descent, a separate step applied after backpropagation finishes. Swap gradient descent for Adam or RMSProp and every gradient computed here is unchanged; only the update rule differs.
