3.2.3 · HinglishTraining Deep Networks

Momentum and Nesterov momentum

1,966 words9 min readRead in English

3.2.3 · AI-ML › Training Deep Networks


KIYA hai wo problem jo hum fix kar rahe hain?

Plain (vanilla) gradient descent update:

Step sirf current gradient par depend karta hai. Agar gradients ek valley ke across sign flip karte rehte hain, toh progress cancel ho jaati hai. Hum chahte hain ki past ko yaad rakha jaaye taaki yeh smooth ho sake.


Momentum — pehle principles se derive karna

Step 1 — Ek velocity define karo past gradients ke exponentially weighted average ke roop mein. ko momentum coefficient hone do (kitna past hum rakhte hain):

Yeh step kyun? Unrolling se milta hai — ek weighted sum jahan recent gradients sabse zyada count karte hain aur purane geometrically decay karte hain. Woh ek smoothed gradient hai.

Step 2 — Raw gradient ki jagah velocity ke saath step lo:

Figure — Momentum and Nesterov momentum

Nesterov momentum — ek smarter look-ahead

Step 1 — Look-ahead point compute karo (jahan sirf momentum humein le jaata):

Yeh step kyun? Yeh anticipated position hai. Gradient ko yahan evaluate karne se zyada up-to-date curvature information milti hai.

Step 2 — Look-ahead gradient use karke velocity update karo:

Step 3 — Step lo:


Worked examples


Common mistakes (steel-manned)


80/20 — essentials

Recall Feynman: 12-saal ke bacche ko explain karo

Socho ek ball ko ek bumpy pahaad se neeche roll karna, instead of ek-ek careful step lene ke. Kyunki ball bhaari hai, woh usi direction mein chalti rehti hai jis taraf ja rahi thi, toh woh lambi slope ke neeche speed up karti hai aur chote bumps se uchhalti nahi. Yeh hai momentum. Nesterov ek thoda smarter ball hai jo thoda aage dekhti hai ki woh kahan roll karne wali hai, aur agar woh dekhti hai ki woh overshoot karne wali hai, toh pehle hi slow ho jaati hai. Toh woh usi ball se tezi se aur smoothly bottom tak pahunchti hai jo sirf apne neeche jo hai uspe react karti hai.


Flashcards

Plain gradient descent kaunsa update rule use karta hai?
— sirf raw current gradient ke saath step.
Plain GD narrow valleys mein zig-zag kyun karta hai?
Loss ill-conditioned hai; steep direction ke liye chota chahiye jo flat direction ke liye bahut chota hai, toh steep walls ke paas oscillate karta hai.
Classical (Polyak) momentum equations likho.
, phir .
intuitively kya hai?
Past gradients ka exponentially weighted moving average: .
Consistent direction mein effective learning rate kya hoti hai?
— jaise jab .
Momentum oscillating gradients ko kaise handle karta hai?
Running average mein sign-flipping components zyaadatar cancel ho jaate hain, zig-zag ko damp karte hue.
Ek sentence mein Nesterov classical momentum se kaise differ karta hai?
Yeh gradient ko look-ahead point par evaluate karta hai instead of par.
Nesterov update likho.
; ; .
Nesterov ka look-ahead helpful kyun hai?
Yeh anticipate karta hai ki momentum tumhe kahan le jaayega aur overshoot hone se pehle correct karta hai, smoother/faster convergence deta hai.
ki typical value kya hai?
Lagbhag (kabhi kabhi tak).
Agar bahut zyada ho toh kya galat hota hai?
"Ball" bahut bhaari ho jaati hai → overshoot karta hai aur minimum ke around orbit karta hai, settle hone mein deri lagti hai.
Steel-man: kya momentum sirf ek bada learning rate hai?
Nahi — yeh direction-selective hai: yeh consistent directions enlarge karta hai lekin oscillating ones cancel karta hai; bada steep direction ko blow up kar deta.
Nesterov se convex convergence rate improvement kya hai?
vs plain GD ka .

Connections

  • Gradient Descent — woh baseline jise momentum improve karta hai.
  • Stochastic Gradient Descent (SGD) — momentum usually mini-batch SGD par apply hota hai.
  • Adam Optimizer — momentum (1st moment) ko adaptive scaling (2nd moment) ke saath combine karta hai.
  • RMSProp — adaptive learning rates; aksar momentum se compare kiya jaata hai.
  • Hessian and Condition Number — kyun ill-conditioning momentum ko zaroori banata hai.
  • Exponentially Weighted Moving Average — woh math jo velocity ke underlying hai.
  • Learning Rate Schedules — stability ke liye ke saath interact karta hai.

Concept Map

causes

uses only current gradient

needs small learning rate

motivates

amplifies signal, cancels noise

controlled by

step along velocity

effective LR eta over 1-beta

equivalent to

improved by look-ahead

gradient at look-ahead point

Ill-conditioning: high condition number

SGD zig-zags in valleys

Plain gradient descent

Slow along flat floor

Velocity: EW average of gradients

Classical Polyak momentum

Momentum coefficient beta

Theta updated by eta times v

Up to 10x speed-up

Heavy-ball rewriting

Nesterov momentum

Faster, more responsive