Here x is the input number, t is the target (the "right answer" we wanted), y^ (read "y-hat") is the network's guess, and L is the loss — a single number measuring how wrong the guess is. The letters w (weights) and b (biases) are the tunable knobs. The symbol σ (read "sigma") is the activation function, a bend applied to a number; σ′(z) is its slope at z. The Greek δ (read "delta") is the error signal at a node: δ=∂L/∂z, i.e. "how much the loss changes if this node's pre-activation value z nudges."
Look at the figure above: the orange arrows run left-to-right (the forward pass, computing the guess), the magenta arrows run right-to-left (the backward pass, carrying δ). Every exercise below is one journey along those arrows.
The chain rule. For nested (composed) functions, sensitivities multiply: if x wiggles by a tiny amount, f1 wiggles by f1′ times that, then f2 wiggles by f2′ times that, and so on. Chaining these scalings gives
dxdL=f3′⋅f2′⋅f1′.
A sum appears only when x reaches L through several separate paths (the multivariable chain rule); a straight chain is one path, so it is a pure product. See Chain Rule.
Recall Solution L1.2
Differentiate 21(y^−t)2 with respect to y^: the 21 and the power-2 cancel, leaving
∂y^∂L=y^−t.
It is the seed because it is the very first number of the backward pass — the "how wrong are we, and in which direction" quantity that every later gradient is grown from.
Recall Solution L1.3
The forward step multiplies inputs by the matrix W (a linear map). The derivative of a linear map Wa with respect to its input a is the transpose W⊤ (rows and columns swapped), not the inverse. Backprop is differentiation, and differentiating a linear map transposes it; nothing here undoes/inverts anything.
Use x=1,t=0,w1=0.5,b1=0,w2=2,b2=0 with σ=ReLU. ReLU (Rectified Linear Unit) is σ(z)=max(0,z): it passes positives unchanged and clamps negatives to 0. Its slope is σ′(z)=1 for z>0 and 0 for z<0. See Activation Functions.
Recall Solution L2.1
Walk the orange arrows of Figure 1:
z1=w1x+b1=0.5(1)+0=0.5,a1=ReLU(0.5)=0.5,z2=w2a1+b2=2(0.5)+0=1.0,y^=z2=1.0,L=21(y^−t)2=21(1−0)2=0.5.
Recall Solution L2.2
Seed then chain. Since y^=z2, ∂y^/∂z2=1, so
δ2=∂z2∂L=∂y^∂L⋅1=(y^−t)=1.
Because z2=w2a1+b2: ∂z2/∂w2=a1 and ∂z2/∂b2=1. Hence
∂w2∂L=δ2a1=1×0.5=0.5,∂b2∂L=δ2=1.
Read it as error out × signal in: the gradient of w2 is its downstream error (1) times its own input (a1=0.5).
Recall Solution L2.3
Error flows back through w2 and is scaled by the local slope σ′(z1). Since z1=0.5>0, σ′(z1)=1:
δ1=δ2w2σ′(z1)=1×2×1=2.
Then with ∂z1/∂w1=x and ∂z1/∂b1=1:
∂w1∂L=δ1x=2×1=2,∂b1∂L=δ1=2.
Forward: z1=−3(1)+0=−3, so a1=ReLU(−3)=0, z2=2(0)+0=0, y^=0, L=21(0−0)2=0.
Backward: δ2=y^−t=0. Even the seed is zero. And the slope σ′(z1)=0 because z1<0. So
δ1=δ2w2σ′(z1)=0×2×0=0,∂w1∂L=δ1x=0.All layer-1 gradients vanish. The ReLU is in its flat region — the unit is "dead." No error can pass a zero slope, so learning stalls for w1,b1. This is a baby case of Vanishing Gradients.
Recall Solution L3.2
The chain rule factors ∂L/∂w into a product of local derivatives. Each δ is computed once and reused for every weight feeding that node: δ1 is built from δ2 (already known), and every weight's gradient is δ×(its input). So one backward sweep reuses cached quantities and touches each edge once — total work is proportional to the number of edges, i.e. one forward pass' worth. The naïve finite-difference method instead re-runs the whole net per weight: O(#weights) passes. This reuse is exactly what Automatic Differentiation mechanises. See Computational Graphs.
Recall Solution L3.3
∂a∂L=uδA+vδB.
The value a influences L along two independent paths. The multivariable chain rule says total sensitivity is the sum of per-path sensitivities — each path's contribution is (weight on that path) × (error at that path's target). Look at Figure 2: the two magenta arrows meet at a and their blames add.
Forward: z1=0.5(1)+(−1)(2)+0=0.5−2=−1.5. ReLU clamps: a1=max(0,−1.5)=0. Then z2=2(0)=0, y^=0, L=21(0)2=0.
Backward: δ2=y^−t=0; slope σ′(z1)=0 (since z1<0); δ1=δ2w2σ′(z1)=0.
The weight gradient is the outer product "error × input": ∂L/∂w1=δ1x⊤=0⋅[1,2]=[0,0], and ∂L/∂b1=δ1=0.
Every gradient is zero — again a dead unit. This shows the vector rule reproduces the scalar logic elementwise.
Recall Solution L4.2
Forward: z1=0.5(1)+1(2)=2.5>0, so a1=2.5; z2=2(2.5)=5, y^=5, L=21(5−0)2=12.5.
Backward: δ2=y^−t=5. ∂L/∂w2=δ2a1=5(2.5)=12.5, ∂L/∂b2=5.
σ′(z1)=1 (positive), so δ1=δ2w2σ′(z1)=5(2)(1)=10.
Vector weight gradient (outer product):
∂w1∂L=δ1x⊤=10[1,2]=[10,20],∂b1∂L=δ1=10.
Notice each component is δ1× (the corresponding input) — the weight touching the bigger input (x2=2) gets the bigger gradient.
Recall Solution L4.3
Update rule w←w−η∂L/∂w:
w2new=2−0.01(12.5)=1.875,b2new=0−0.01(5)=−0.05.
Sanity: with a1=2.5 still, new y^=1.875(2.5)−0.05=4.6875−0.05=4.6375, new L=21(4.6375)2≈10.753. Since 10.753<12.5, the loss decreased — gradient descent stepped downhill, as intended.
Forward: z1=0.5, a1=σ(0.5)=1+e−0.51≈0.622459. Then z2=2(0.622459)=1.244918, y^=1.244918, L=21(1.244918)2≈0.774910.
Backward: δ2=y^−t≈1.244918. Local slope σ′(z1)=a1(1−a1)=0.622459(0.377541)≈0.234988.
δ1=δ2w2σ′(z1)≈1.244918×2×0.234988≈0.585062.∂w1∂L=δ1x≈0.585062.Saturation: as ∣z1∣→∞, σ(z1)→0 or 1, so σ′(z1)=σ(1−σ)→0. Since δ1 carries a factor σ′(z1), the gradient is throttled toward 0 — the classic sigmoid Vanishing Gradients problem. The peak slope is only σ′(0)=0.25, so even at best sigmoids shrink error by 41 per layer.
Recall Solution L5.2
With the sigmoid net, L(w1)=21(2σ(w1))2=2σ(w1)2 (since x=1,b=0,w2=2).
L+=2σ(0.5001)2, L−=2σ(0.4999)2. Numerically the slope estimate 2ϵL+−L−≈0.58506, matching L5.1's 0.585062 to five decimals. ✓
Central vs forward: the central formula's error shrinks like ϵ2 (the odd, first-order error terms cancel by symmetry), while a one-sided forward difference errs like ϵ. So the central estimate is far more accurate for the same ϵ.
Recall Solution L5.3
δfront=δseed⋅rn.
r=0.25: rn→0 geometrically — vanishing gradients; deep front layers barely learn.
r=1: rn=1 — error passes intact, the healthy regime that skip-connections and careful initialisation try to engineer.
r=2: rn→∞ — exploding gradients; updates blow up unless clipped.
This single product rn is the reason depth is delicate, and why surrogate nets for aerodynamic data (Neural Network Surrogate Models (CFD)) need normalisation and residual paths to stay in the r≈1 band.