Yeh kyun kaam karta hai: Gradient ∇L(θ)steepest increase ki direction mein point karta hai. Isliye −∇L(θ)steepest decrease ki taraf point karta hai. Gradient ke opposite direction mein baar baar move karke, hum minimum ki taraf "neeche roll" karte hain.
Shuru karo is baat se ki hum gradients use kyun kar sakte hain. Ek point θ ke aas paas, loss function ko approximate kiya ja sakta hai:
L(θ+Δθ)≈L(θ)+∇L(TˆΔθ
Yeh step kyun? Taylor's theorem kehta hai ki koi bhi smooth function locally linear hoti hai. Gradient ∇L(θ) humein batata hai ki chote Δθ ke liye L kaise change hoti hai.
Momentum and Adam — Velocity/adaptive rates ke saath enhanced GD
Convex Optimization — Convex L ke liye GD global minimum guarantee karta hai
Local Minima and Saddle Points — Non-convex landscapes mein challenges
Second-Order Methods — Newton's method sirf gradient nahi, Hessian bhi use karta hai
Recall Ek 12-Saal ke Bacche ko Samjhao
Socho tum ek video game khel rahe ho jahan tum ek pahaad par maze mein faase ho, aur tumhe neeche khazaana dhundhna hai. Lekin bahut zyaada fog hai — tum sirf apne paon dekh sakte ho!
Tumhari strategy yeh hai:
Zameen feel karo. Kaun sa taraf neeche jhukta hai? Yahi tumhara hint hai.
Neeche ki taraf ek chota sa step lo.
Ruko aur phir feel karo. Repeat karo.
Gradient descent exactly yehi hai! Tumhara "zameen feel karna" gradient (dhaalan) calculate karna hai. "Neeche step lena" tumhari position ko is rule se update karna hai:
new position=old position−(step size)×(slope)
"Step size" ko learning rate kehte hain. Bahut bada ho toh tum trip karke khazaane se aage nikal jaoge. Bahut chota ho toh tumhe wahan pahunchne mein zamaana lag jaega.
Machine learning mein, "khazaana" woh best model parameters hain jo tumhari predictions ko super accurate banate hain!
What is the gradient descent update rule? :: θt+1=θt−η∇L(θt), where η is the learning rate and ∇L(θt) is the gradient at θt.
Why do we use the NEGATIVE gradient in gradient descent?
The gradient ∇L points in the direction of steepest INCREASE of the loss. We want to DECREASE loss, so we move in the opposite direction: −∇L.
What happens if the learning rate η is too large? :: The updates overshoot the minimum, causing the loss to oscillate or diverge instead of converging. The linear approximation (Taylor expansion) breaks down.
What happens if the learning rate η is too small? :: Convergence is extremely slow — the algorithm takes tiny steps and requires many iterations to reach the minimum.
In the hill analogy, what does the gradient represent?
The gradient represents the direction and stepness of the slope. It points UPHILL (stepest ascent), so we go the opposite way to descend.
Derive the gradient descent direction from first principles.
Using Taylor expansion: L(θ+Δθ)≈L(θ)+∇L(θ)TΔθ. To minimize the change, we need ∇L(θ)TΔθ<0. This is most negative when Δθ is antiparallel to ∇L, giving Δθ=−η∇L(θ).
What is the "stepest descent" property of gradient descent?
Among all directions with the same step magnitude, the negative gradient direction produces the largest decrease in the loss function (locally, under first-order approximation).
In Example 1 (L(θ)=θ2), why does θt=4⋅(0.8)t?
Each update multiplies the current value by (1−2η)=1−0.2=0.8 (since ∇L=2θ and η=0.1), forming a geometric sequence converging to 0.