Before we start, one picture to fix the vocabulary we reuse in every problem: a computational graph is just boxes (variables) joined by arrows (each arrow is one derivative). "Chain rule" = multiply the arrow-derivatives along a path, then add up all paths that reach the target.
WHAT: We count paths from x to z. There are two: one through u, one through v.
WHY: Each independent route contributes one product of arrow-derivatives; the chain rule sums them.
∂x∂z=path via u∂u∂z∂x∂u+path via v∂v∂z∂x∂vAnswer: 2 terms, each a product of two arrow-derivatives.
Recall Solution 1.2
a is linear in each variable. The derivative w.r.t. a variable is just the coefficient sitting next to it.
∂w1∂a===x==,∂x∂a===w1==WHY:∂w1∂(w1x+b1)=x because x,b1 are constants w.r.t. w1.
Recall Solution 1.3
No. It drops the second path through v. Complete answer needs +∂v∂z∂x∂v.
Step 1 — arrow-derivatives.∂u∂z=2uv,∂v∂z=u2,∂x∂u=1,∂x∂v=yStep 2 — sum the two paths (x→u→z and x→v→z).∂x∂z=2uv⋅1+u2⋅y=2uv+u2yStep 3 — plug inx=1,y=2: then u=3,v=2.
=2(3)(2)+(3)2(2)=12+18===30==
Recall Solution 2.2
Only one path r→u→z, so we just multiply.
drdz=dudzdrdu=cos(u)⋅6r=6rcos(3r2)
At r=1: u=3, so drdz=6cos3≈==−5.9399==.
Recall Solution 2.3
WHY this identity matters: it lets backprop reuse the already-computed forward value h instead of recomputing exponentials.
σ′(a)=(1+e−a)2e−a=1+e−a1⋅1+e−ae−a=σ(a)(1−σ(a))=h(1−h)
At a=0: h=σ(0)=0.5, so dadh=0.5×0.5===0.25== (the maximum slope of the sigmoid).
Chain rule (two paths x→p→z, x→q→z):dxdz=∂p∂zdxdp+∂q∂zdxdq=q⋅ex+p⋅2e2x
Substitute p=ex,q=e2x:
=e2xex+ex⋅2e2x=e3x+2e3x=3e3xDirect:z=exe2x=e3x⇒dxdz=3e3x. ✓
At x=0: both give 3e0===3==.
Recall Solution 3.2
Solve h(1−h)≤0.01. Roots of h−h2=0.01: h=21±1−0.04=21±0.96.
0.96≈0.97980⇒h≤0.01010orh≥0.98990Meaning: when the neuron is saturated (output near 0 or near 1), its arrow-derivative is nearly 0, so its contribution to every gradient is crushed — this is the seed of Vanishing and Exploding Gradients. See also Activation Functions for functions that dodge this.
Answer: vanishes for h≲==0.0101== or h≳==0.9899==.
Recall Solution 3.3
(y−t)=0.8−1=−0.2,h(1−h)=0.6×0.4=0.24∂w1∂L=(−0.2)(2)(0.24)(3)===−0.288==WHAT it means: gradient descent updates w1←w1−η∂w1∂L. The gradient is negative, so −η(negative) is positive → w1increases. (See Gradient Descent.)
Forward pass (left to right).a=0.5(1)+0=0.5,h=σ(0.5)=1+e−0.51≈0.62246y=1⋅h+0=0.62246,L=21(0.62246−0)2≈0.19373Backward pass (right to left). Reuse each stored value.
∂y∂L=y−t=0.62246∂w2∂L=∂y∂L⋅∂w2∂y=0.62246⋅h=0.62246×0.62246≈==0.38746==∂b2∂L=∂y∂L⋅1===0.62246==
Now push into the hidden layer. ∂h∂y=w2=1, ∂a∂h=h(1−h)=0.62246×0.37754≈0.23500.
∂a∂L=∂y∂L⋅w2⋅h(1−h)=0.62246⋅1⋅0.23500≈0.14628∂w1∂L=∂a∂L⋅x=0.14628×1≈==0.14628==∂b1∂L=∂a∂L⋅1≈==0.14628==WHY w1 and b1 share ∂a∂L: both branch off the same node a, whose upstream gradient is computed once and reused — that reuse isbackprop on the computational graph.
Recall Solution 4.2
For linear maps the Jacobian is the matrix: ∂u∂z=A, ∂x∂u=B.
By the vector chain rule, ∂x∂z=AB (see Jacobian and Hessian Matrices).
AB=[1023][2101]=[1⋅2+2⋅10⋅2+3⋅11⋅0+2⋅10⋅0+3⋅1]=[==4====3====2====3==]
Step 1 — sum both output paths into h:dhdL=∂y1∂Ldhdy1+∂y2∂Ldhdy2=1⋅1+1⋅2h=1+2hStep 2 — one more arrow to x:dxdh=2.
dxdL=dhdL⋅dxdh=(1+2h)⋅2Step 3 — at x=1:h=2, so =(1+4)⋅2===10==.
This is the "fan-out then fan-in" pattern real graphs use everywhere — see Loss Functions for multi-term losses.
Recall Solution 5.2
(a)wnew=w−ηg=2.0−0.1(0.4)=2.0−0.04===1.96==.
(b) To first order, ΔL≈gΔw. Choosing Δw=−ηg gives ΔL≈g(−ηg)=−ηg2≤0. Since g2≥0 and η>0, L can only stay the same (if g=0) or decrease. That is the whole justification of Gradient Descent.
Recall Solution 5.3
∏i=1100.25=0.2510===9.5367×10−7==Lesson: each layer shrinks the gradient by ≤4×; after 10 layers the signal reaching early weights is a millionth, so they barely learn. This is the vanishing-gradient problem, motivating ReLU-type Activation Functions whose slope is 1 (no shrink).
Recall Self-check :::
One-path chain rule multiplies; multi-path chain rule ::: multiplies along each path, then adds the paths.
Sigmoid's maximum slope h(1−h) occurs at h= ::: 0.5, giving 0.25.
Backprop reuses each node's upstream gradient how many times? ::: Once, shared to all its children.