Yahan x input number hai, t target hai (woh "sahi jawab" jo hum chahte the), y^ (padho "y-hat") network ki guess hai, aur L loss hai — ek single number jo measure karta hai ki guess kitni galat hai. Letters w (weights) aur b (biases) tunable knobs hain. Symbol σ (padho "sigma") activation function hai, ek bend jo ek number par apply hoti hai; σ′(z) uski slope hai z par. Greek δ (padho "delta") ek node par error signal hai: δ=∂L/∂z, yaani "loss kitna change hota hai agar is node ki pre-activation value z thodi si nudge kare."
Upar figure dekho: orange arrows left-to-right jaate hain (forward pass, guess compute karta hai), magenta arrows right-to-left jaate hain (backward pass, δ carry karta hai). Neeche har exercise un arrows ke saath ek journey hai.
Chain rule. Nested (composed) functions ke liye, sensitivities multiply hoti hain: agar x thoda sa wiggle kare, toh f1 wiggle karta hai f1′ times us amount se, phir f2 wiggle karta hai f2′ times us se, aur aise aage. In scalings ko chain karne se milta hai
dxdL=f3′⋅f2′⋅f1′.Sum tab aata hai jab x, L tak alag-alag kai paths se pahunchta hai (multivariable chain rule); ek seedha chain ek hi path hai, isliye yeh pure product hai. Dekho Chain Rule.
Recall Solution L1.2
21(y^−t)2 ko y^ ke respect mein differentiate karo: 21 aur power-2 cancel ho jaate hain, bacha
∂y^∂L=y^−t.
Yeh seed isliye hai kyunki yeh backward pass ka sabse pehla number hai — "hum kitne galat hain, aur kis direction mein" wali quantity, jisse baad ke saare gradients ugaaye jaate hain.
Recall Solution L1.3
Forward step inputs ko matrix W se multiply karta hai (ek linear map). Input a ke respect mein linear map Wa ki derivative transpose W⊤ hai (rows aur columns swap ho jaate hain), inverse nahi. Backprop differentiation hai, aur ek linear map ko differentiate karna use transpose karta hai; yahan kuch bhi undo/invert nahi ho raha.
Use karo x=1,t=0,w1=0.5,b1=0,w2=2,b2=0 with σ=ReLU. ReLU (Rectified Linear Unit) hai σ(z)=max(0,z): positives ko unchanged pass karta hai aur negatives ko 0 par clamp karta hai. Iska slope hai σ′(z)=1 for z>0 aur 0 for z<0. Dekho Activation Functions.
Recall Solution L2.1
Figure 1 ke orange arrows walk karo:
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 phir chain. Kyunki y^=z2 hai, ∂y^/∂z2=1, isliye
δ2=∂z2∂L=∂y^∂L⋅1=(y^−t)=1.
Kyunki z2=w2a1+b2 hai: ∂z2/∂w2=a1 aur ∂z2/∂b2=1. Isliye
∂w2∂L=δ2a1=1×0.5=0.5,∂b2∂L=δ2=1.
Isko aise padho — error out × signal in: w2 ka gradient uska downstream error (1) times uska apna input (a1=0.5) hai.
Recall Solution L2.3
Error w2 se back flow karta hai aur local slope σ′(z1) se scale hota hai. Kyunki z1=0.5>0 hai, σ′(z1)=1:
δ1=δ2w2σ′(z1)=1×2×1=2.
Phir ∂z1/∂w1=x aur ∂z1/∂b1=1 ke saath:
∂w1∂L=δ1x=2×1=2,∂b1∂L=δ1=2.
Forward: z1=−3(1)+0=−3, toh a1=ReLU(−3)=0, z2=2(0)+0=0, y^=0, L=21(0−0)2=0.
Backward: δ2=y^−t=0. Seed bhi zero hai. Aur slope σ′(z1)=0 hai kyunki z1<0 hai. Toh
δ1=δ2w2σ′(z1)=0×2×0=0,∂w1∂L=δ1x=0.Saare layer-1 gradients vanish ho jaate hain. ReLU apne flat region mein hai — unit "dead" hai. Koi error zero slope se pass nahi kar sakta, toh w1,b1 ke liye learning ruk jaati hai. Yeh Vanishing Gradients ka ek baby case hai.
Recall Solution L3.2
Chain rule ∂L/∂w ko local derivatives ke product mein factor karta hai. Har δek baar compute hota hai aur us node ko feed karne wale har weight ke liye reuse hota hai: δ1δ2 se build hota hai (jo pehle se known hai), aur har weight ka gradient δ×(uska input) hai. Toh ek backward sweep cached quantities reuse karta hai aur har edge ko ek baar touch karta hai — total kaam edges ki sankhya ke proportional hai, yaani ek forward pass jitna. Naive finite-difference method instead poore net ko per weight re-run karta hai: O(#weights) passes. Yahi reuse hai jo Automatic Differentiation mechanise karta hai. Dekho Computational Graphs.
Recall Solution L3.3
∂a∂L=uδA+vδB.
Value a, L ko do independent paths se influence karta hai. Multivariable chain rule kehta hai total sensitivity per-path sensitivities ka sum hai — har path ka contribution (us path par weight) × (us path ke target par error) hai. Figure 2 dekho: do magenta arrows a par milte hain aur unke blames add hote hain.
Forward: z1=0.5(1)+(−1)(2)+0=0.5−2=−1.5. ReLU clamp karta hai: a1=max(0,−1.5)=0. Phir z2=2(0)=0, y^=0, L=21(0)2=0.
Backward: δ2=y^−t=0; slope σ′(z1)=0 (kyunki z1<0); δ1=δ2w2σ′(z1)=0.
Weight gradient outer product "error × input" hai: ∂L/∂w1=δ1x⊤=0⋅[1,2]=[0,0], aur ∂L/∂b1=δ1=0.
Har gradient zero hai — phir ek dead unit. Yeh dikhata hai ki vector rule scalar logic ko elementwise reproduce karta hai.
Recall Solution L4.2
Forward: z1=0.5(1)+1(2)=2.5>0, toh 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), toh δ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 karo ki har component δ1× (corresponding input) hai — bade input (x2=2) ko touch karne wala weight bada gradient pata hai.
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 check: a1=2.5 abhi bhi hai, new y^=1.875(2.5)−0.05=4.6875−0.05=4.6375, new L=21(4.6375)2≈10.753. Kyunki 10.753<12.5 hai, loss decrease hua — gradient descent downhill step liya, jaise intended tha.
Forward: z1=0.5, a1=σ(0.5)=1+e−0.51≈0.622459. Phir 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: jab ∣z1∣→∞, σ(z1)→0 ya 1, toh σ′(z1)=σ(1−σ)→0. Kyunki δ1 mein σ′(z1) ka factor hai, gradient 0 ki taraf throttle ho jaata hai — classic sigmoid Vanishing Gradients problem. Peak slope sirf σ′(0)=0.25 hai, toh best case mein bhi sigmoids error ko 41 per layer shrink karte hain.
Recall Solution L5.2
Sigmoid net ke saath, L(w1)=21(2σ(w1))2=2σ(w1)2 (kyunki x=1,b=0,w2=2).
L+=2σ(0.5001)2, L−=2σ(0.4999)2. Numerically slope estimate 2ϵL+−L−≈0.58506, jo L5.1 ke 0.585062 se paanch decimals tak match karta hai. ✓
Central vs forward: central formula ka error ϵ2 ki tarah shrink karta hai (odd, first-order error terms symmetry se cancel ho jaate hain), jabki one-sided forward difference ϵ ki tarah err karta hai. Toh central estimate same ϵ ke liye bahut zyada accurate hai.
Recall Solution L5.3
δfront=δseed⋅rn.
r=0.25: rn→0 geometrically — vanishing gradients; deep front layers barely learn karte hain.
r=1: rn=1 — error intact pass hota hai, healthy regime jo skip-connections aur careful initialisation engineer karne ki koshish karte hain.
r=2: rn→∞ — exploding gradients; updates blow up ho jaate hain jab tak clip na karein.
Yeh single product rn hi woh reason hai kyun depth delicate hai, aur kyun aerodynamic data ke surrogate nets (Neural Network Surrogate Models (CFD)) ko r≈1 band mein rehne ke liye normalisation aur residual paths ki zaroorat hoti hai.