freecoding.school100% FREE · NO SIGNUP
Tensor TownISSUE #24 of 120

backpropagation · how gradients flow

NeuraVSThe Overfit Ogre
Neura saysBackpropagation efficiently computes the gradient for every weight via the chain rule.

To do gradient descent in a deep net, you need each weight's gradient. Backprop computes them in one backward pass: run the input forward to get the loss, then propagate the error backward layer by layer using the chain rule, reusing intermediate results. It's what makes training deep networks computationally feasible — the algorithm that powers all modern deep learning.

Power-ups you unlock

The Overfit Ogre attacks — common mistakes

Boss battleDescribe the forward-then-backward flow of one training step.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>forward:  input → layers → prediction → loss
backward: loss → gradients back through layers (chain rule)
update weights → repeat</pre></body></html>
▶ Open the interactive comic issue
‹ Gradient Descent · The OptimizerLearning Rate · The Most Important Knob ›