Boss lesson · Unit 02
Backprop by hand
Multiply local slopes backward through one neuron
What you practise
- The chain rule multiplies local slopes
- A tiny computation graph run forward then backward
- The gradient of a one-neuron loss, checked against a numerical estimate
Try a question from this lesson
Pick one
Gear A turns gear B 3 times for each of its own turns. Gear B turns gear C 2 times per turn. Turn A once: how often does C turn?
Correct answer
6
Why
Rates along a chain multiply: 3 × 2 = 6. Adding them (5) would be right only if A drove C directly as well. This is the chain rule, and it is how a network finds its gradients.
The ideas
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
The chain rule
When y depends on u and u depends on x, a nudge to x travels through u to reach y. The slopes multiply:
dy/dx = dy/du × du/dx
Each factor is a local slope: it only looks at one link of the chain. A neural network is a long chain of simple links, so its gradient is a long product of simple slopes.
x --> u = 3x --> y = u²
du/dx = 3 dy/du = 2u
dy/dx = 2u × 3 = 6uConcept
Forward, then backward
The neuron is a chain: w feeds the prediction p, and p feeds the loss L.
Forward pass: compute each value and keep it. Backward pass: start at the loss and multiply local slopes on the way back to each parameter.
This is backpropagation. Frameworks like PyTorch do it for you, with exactly these steps.
w --> p = w·x + b --> L = (p - y)²
dL/dp = 2(p - y)
dp/dw = x dp/db = 1
dL/dw = 2(p - y) · x
dL/db = 2(p - y) · 110 more exercises in the app
- 4× type the answer
- 3× multiple choice
- 1× fill the blanks
- 1× true or false
- 1× order the lines
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.