4.10.20 · D1 · Maths › Advanced Topics (Elite Level) › Gradient descent and variants — convergence analysis
Intuition Ek idea jo sab kuch chalata hai
Gradient descent bas fog mein pahad se neeche lugna hai: sabse steep neeche ki slope feel karo, usi taraf step lo, repeat karo. Saari convergence theory ek sawaal ka bookkeeping hai — kitna bada step safe hai, aur hum bottom tak kitni tez pahunchte hain? — aur jawab poori tarah se is baat pe depend karta hai ki pahad kitna curved hai.
Yeh page toolbox hai. Parent note symbols ki barish tezi se karta hai. Yahan hum har ek symbol zero se earn karte hain — pehle saadhe alfaaz, phir ek picture, phir kyun yeh topic us ke bina nahi chal sakta . Koi bhi cheez use hone se pehle build ki jaati hai. Upar se neeche padho; har item sirf upar waali cheez pe lean karta hai.
Kisi bhi symbol se pehle, mental picture fix karo.
f jo hum minimize karna chahte hain
Hum likhte hain f : R n → R . Saadhe alfaaz mein: tum f ko ek location do — n numbers ki ek list — aur woh tumhe ek height number deta hai.
R n = "n real numbers ki saari lists", jaise ek point ( x , y ) jab n = 2 ho.
→ R = "ek real number output karta hai", yani height.
Picture (figure s01): n = 2 ke liye, ek pahadi landscape imagine karo. Floor ( x , y ) plane hai; har floor-point ke upar ki height f hai. Hamara goal woh floor-point dhundna hai jo surface ke sabse neeche hisse ke neeche baitha ho.
Intuition Figure s01 padho
White curve f hai. Blue dotted line ek sample location x (floor pe blue dot) se uske height f ( x ) tak jaati hai. Pink dot x ⋆ mark karta hai, valley ka bottom; yellow dashed line uski height f ⋆ mark karti hai. Neeche har symbol is ek picture mein kahin na kahin rehta hai.
Topic ko yeh kyun chahiye: baad mein aane waala har symbol is landscape ko describe karta hai — uski slope, uski curvature, uska lowest point. Agar tum landscape nahi dekh rahe, toh algebra sirf shor hai.
Kyun chahiye: har convergence bound x ⋆ se door ya f ⋆ ke upar height gap ke roop mein measure hoti hai. Yeh finish line hain.
Ek location x ∈ R n ek vector hai: origin se us floor-point tak ek arrow.
∥ v ∥ — ek vector ki length
v = ( v 1 , … , v n ) ke liye,
∥ v ∥ = v 1 2 + v 2 2 + ⋯ + v n 2 .
Saadhe alfaaz: arrow ki seedhi-line length (Pythagoras n dimensions mein).
Picture: 2D mein, ∥ ( 3 , 4 ) ∥ = 9 + 16 = 5 — 3-by-4 right triangle ka hypotenuse.
Kyun chahiye: convergence ka matlab hai "gap chhota hota ja raha hai". Yeh kehne ke liye ki kuch chhota ho raha hai, hume use measure karna hoga — aur ∥ x k − x ⋆ ∥ (current point se goal ki distance) exactly wahi measuring stick hai.
∥ v ∥ har coordinate pe ∣ v ∣ nahi hai
∥ v ∥ poore arrow ke liye ek number hai, absolute values ki list nahi. Yeh saare coordinates ko square-root-of-sum-of-squares ke through combine karta hai.
Definition Dot product (inner product)
Do vectors u , v ∈ R n ke liye:
u ⊤ v = u 1 v 1 + u 2 v 2 + ⋯ + u n v n .
Chhota ⊤ ("transpose") bas numbers ke column ko side pe karta hai taaki multiplication align ho; u ⊤ v ko "u dot v " padh sakte ho.
Picture (figure s02): u ⊤ v = ∥ u ∥ ∥ v ∥ cos θ , jahan θ arrows ke beech ka angle hai. Toh yeh measure karta hai ki do arrows kitna same direction mein point karte hain : jab aligned ho toh maximum, jab perpendicular ho toh zero, jab opposite ho toh negative.
Intuition Figure s02 padho
Blue arrow u hai, pink arrow v hai, aur θ dono ke beech ka chalk angle hai. Yellow dotted drop v ki shadow u pe hai; uski length u ⊤ v /∥ u ∥ hai. v ko u ki taraf swing karo (theta chhota karo) aur shadow — dot product — barta hai; inhe perpendicular karo aur yeh gayab ho jaata hai.
Topic ko yeh kyun chahiye: ek direction mein slope ek dot product hai (∇ f ⊤ u , agla section), aur poora "steepest descent" argument yeh hai ki "kaunsa direction u is dot product ko sabse zyada negative banata hai?"
Kyun chahiye: yeh ek line hai jo prove karti hai ki − ∇ f steepest direction hai, aur yeh descent-lemma integral ko bound karte waqt bhi aata hai (Section 9). Yeh cap karta hai ki dot product kitna bada ho sakta hai.
Yahan show ka star hai.
Definition Partial derivative
∂ x i ∂ f
i -th coordinate ke alawa sab kuch freeze karo, phir pucho "agar main sirf x i nudge karun, toh height kitni tez badlegi?" Woh rate partial derivative hai. (Single-variable derivative ke liye jo iske neeche hai, Taylor's Theorem and the Fundamental Theorem of Calculus dekho.)
∇ f ( x )
Saare partials ko ek vector mein collect karo:
∇ f ( x ) = ( ∂ x 1 ∂ f , … , ∂ x n ∂ f ) .
∇ ko "nabla" ya "grad" padho.
Picture (figure s03): kisi bhi floor-point pe, ∇ f ek arrow hai jo floor plane mein lie karta hai aur steepest uphill direction mein point karta hai, aur uski length batata hai ki woh climb kitni steep hai. Toh − ∇ f steepest downhill ki taraf point karta hai — woh direction jisme hum step lete hain.
Intuition Figure s03 padho
White rings contours hain — equal height ki floor-curves, jaise ek topographic map. Pink arrow (+ ∇ f ) rings ke aarpaar zyada upar ki taraf seedha point karta hai; blue arrow (− ∇ f ) ulti taraf point karta hai, neeche ki taraf — wahi direction hai jisme har gradient-descent step actually move karta hai.
Intuition Steepest descent
− ∇ f kyun hai
Jab tum unit-direction u mein step karte ho toh jo slope feel hoti hai woh directional derivative ∇ f ( x ) ⊤ u hai. Cauchy–Schwarz se (Section 2) yeh tab sabse chhota (sabse zyada negative) hota hai jab u exactly ∇ f ke ulte direction mein point kare. Isi liye update gradient subtract karta hai.
Kyun chahiye: poora update rule x k + 1 = x k − η ∇ f ( x k ) is arrow se bana hai. Gradient nahi toh descent nahi.
Definition Stationary point:
∇ f ( x ⋆ ) = 0
Valley floor pe ground har direction mein flat hai, toh saare partials zero hain. Aise hum pehchante hain ki hum pahunch gaye.
Definition Step size (learning rate)
η
η > 0 ("eta") hai kitni door hum har move mein − ∇ f ke along jaate hain. Chhota η = timid baby steps; bada η = bold leaps jo overshoot kar sakti hain.
Definition Iteration index
k aur sequence x k
k = 0 , 1 , 2 , … steps count karta hai. x 0 wahan hai jahan hum shuru karte hain; x k wahan hai jahan hum k steps ke baad khade hain; x k + 1 agla stop hai. Subscript ek time stamp hai, coordinate nahi.
Kyun chahiye: "step kitna bada (η ) aur kitni tez (k )" yahi topic ka central question hai. Dono symbols har bound mein rehte hain.
Slope batata hai kaun si taraf neeche hai; curvature batata hai slope khud kaise badlata hai — aur curvature hi decide karta hai problem kitni mushkil hai.
∇ 2 f ( x )
Saare second partial derivatives ka matrix. Saadhe alfaaz mein: yeh record karta hai gradient kaise murtaa hai jab tum move karte ho — ek point pe landscape ki "bendiness". 1D mein yeh sirf f ′′ ( x ) hai: positive = valley-shaped (upar curve), negative = hill-shaped.
Definition Positive semidefinite matrix
Ek symmetric matrix M positive semidefinite hai (likho M ⪰ 0 ) agar
v ⊤ M v ≥ 0 har direction v ke liye.
Saadhe alfaaz: M ek aisi bowl describe karta hai jo kabhi neeche curve nahi karti — koi bhi direction chuno aur woh jo curvature batayega woh ≥ 0 hoga. Agar inequality strict ho (> 0 for all v = 0 ) toh hum kehte hain positive definite : ek bowl jo har direction mein strictly upar curve karti hai, koi flat channel nahi.
Intuition Yeh itna matter kyun karta hai
"Har direction mein upar curve karna" exactly wahi hai jo ek point ko genuine bottom banata hai na ki saddle ya ridge. Hessian ki positive semidefiniteness algebraic tarika hai yeh kehne ka ki "yeh sach mein ek valley hai".
Definition Matrix ordering
A ⪯ B aur A ⪰ B
A ⪯ B padho "A , B se curvature sense mein chhota ya barabar hai", aur yeh defined hai us idea se jo humne abhi build kiya:
A ⪯ B ⟺ B − A ⪰ 0 ⟺ v ⊤ ( B − A ) v ≥ 0 for all v .
Toh A ⪯ B ka matlab hai B har direction mein A se kam se kam utna upar curve karta hai. Phir:
∇ 2 f ⪯ L I matlab: curvature kabhi L se zyada nahi kisi bhi direction mein (I identity matrix hai — "unit" curvature reference).
∇ 2 f ⪰ μ I matlab: curvature kam se kam μ hai har direction mein.
Picture (figure s04): sach ki curved surface ko do parabolas ke beech trap karo — neeche μ curvature ki ek flatter wali aur upar L curvature ki ek steeper wali.
Intuition Figure s04 padho
White curve sach wali f hai. Neeche blue dashed parabola ki sabse gentle allowed curvature μ hai; upar pink dashed parabola ki sabse steep allowed curvature L hai. Sach wala function dono ke beech yellow band mein squeezed hai — exactly yahi μ I ⪯ ∇ 2 f ⪯ L I kehta hai.
Kyun chahiye: yeh do sandwiching bounds (μ neeche, L upar) sirf yahi facts hain jo convergence proofs use karti hain. Sab kuch — safe step size, speed — is sandwich se squeeze hota hai. Single valley guarantee karne wali convexity (μ ≥ 0 ) ke liye Convex Functions and Optimization dekho.
L — smoothness constant (upper curvature)
f L -smooth hai agar uska gradient rate L se zyada tez kabhi nahi badlata:
∥∇ f ( x ) − ∇ f ( y ) ∥ ≤ L ∥ x − y ∥.
Yeh exactly Lipschitz Continuity hai gradient pe apply hua. Saadhe alfaaz: slope wildly nahi bhag sakti — uska change L times moved distance se cap hota hai. Equivalently (Section 5) ∇ 2 f ⪯ L I : curvature zyada se zyada L .
Kyun chahiye: L safe step size set karta hai (Section 7 mein derive hoga). Kyunki curvature ≤ L hai, η ≈ 1/ L ka step guaranteed overshoot nahi karega.
μ — strong-convexity constant (lower curvature)
f μ -strongly convex hai (μ > 0 ) agar yeh curvature μ ki parabola ki tarah kam se kam itni tez upar curve kare: ∇ 2 f ⪰ μ I . μ = 0 wala case ordinary convexity hai — ek valley jo bottom pe dead flat ho sakti hai.
Kyun chahiye: μ valley ko bottom ki taraf ek definite pull deta hai, jo convergence ko slow O ( 1/ k ) se fast geometric ρ k mein upgrade karta hai (Section 8).
Ab hum woh danger line derive kar sakte hain jo parent note baar baar cite karta hai, sirf L aur bowl ki picture use karke.
Intuition Ek-line takeaway
Steepness L se cap hai, toh 2/ L se lamba step far wall ko itna zyada overshoot karta hai jitna shuru hua tha — aur amplify hota rehta hai. Safe steps ( 0 , 2/ L ) mein rehte hain; sweet spot ≈ 1/ L hai. Yahi fact equipment checklist test karta hai.
Kyun chahiye: yahi precise reason hai ki L (na ki μ ) safe step size control karta hai, aur yeh parent note ke full convergence rates ka seed hai.
Definition Eigenvector aur eigenvalue (symmetric matrix ke liye)
Kisi matrix M ka eigenvector ek special direction v hai jise M rotate nahi karta — sirf stretch karta hai: M v = λ v . Stretch factor λ eigenvalue hai.
Ek key fact: ek symmetric matrix (jaise har Hessian) ke paas eigenvectors ka ek poora set hota hai jo mutually perpendicular hain, aur har ek ke along matrix sirf apne eigenvalue se plain multiplication ki tarah act karta hai. Ise diagonalization kehte hain — axes ko eigenvectors ke saath line up karna messy matrix ko simple stretch factors ki list mein badal deta hai. Eigenvalues and the Condition Number dekho.
Intuition Eigenvalues ka hamare bowl ke liye kya matlab hai
Axes ko Hessian ke eigenvectors ke saath line up karo aur bowl ek clean stack of 1D parabolas ban jaati hai — ek per axis — jisme eigenvalue λ i us axis ki curvature hai. Ek L -smooth, μ -strongly-convex quadratic ke liye har eigenvalue [ μ , L ] mein rehti hai: koi direction μ se flatter ya L se steeper nahi. Isi liye Section 5 ke sandwich ke exactly woh do ends hain.
Definition Condition number
κ = L / μ
Steepest aur shallowest curvature ka ratio, hamesha ≥ 1 . Saadhe alfaaz: valley kitni stretched hai . κ = 1 = bilkul round bowl; κ = 100 = lamba patla ravine.
Picture: round bowl → bottom tak seedha shot. Lamba ravine → narrow direction ke across zig-zag karte hue long axis mein barely move karna.
Definition Contraction / convergence rate
ρ
ρ ∈ [ 0 , 1 ) har step mein rakhi gayi error ka fraction hai: ∥ x k + 1 − x ⋆ ∥ ≤ ρ ∥ x k − x ⋆ ∥ . Chhota ρ = zyada tez. Har eigen-axis ke along Section 7 apply karo aur sabse bura lo, GD jo best achieve kar sakta hai woh ρ ⋆ = κ + 1 κ − 1 hai (star = optimal, η ke upar tuned).
Kyun chahiye: κ woh single number hai jo batata hai GD uda ya creep karega, aur ρ literal speed hai. Headline "momentum κ ko κ mein badal deta hai" yahan rehta hai — Nesterov Acceleration dekho.
∫ 0 1 ( ⋯ ) d t (lemma kaise prove hota hai)
x se y tak seedhe path par t ke 0 se 1 slide karte waqt infinitely many chhote contributions add karna. Yeh vector form mein Calculus ka Fundamental Theorem hai — FTC — aur yahi "curvature ≤ L " ko descent-lemma parabola mein badalta hai.
E [ ⋅ ] (SGD ke liye)
E [ g ] = ek random quantity g ka uske saare possible outcomes pe average value . SGD mein gradient g k ek noisy guess hai jiski average sach wale gradient ke barabar hai: E [ g k ] = ∇ f ( x k ) .
∇ 2 f ⪯ L I vs. Newton's method
Jab tum poora curvature matrix afford kar sako, tum har direction ko apni curvature se rescale kar sakte ho — woh Newton's Method (second-order methods) hai. GD uska sasta cousin hai jo sirf slope use karta hai.
Function f maps R^n to a height
Vector length norm measures the gap
Gradient grad f = steepest uphill arrow
Dot product and Cauchy-Schwarz
Update rule step of size eta
Positive semidefinite = curves up everywhere
L smoothness upper curvature
mu strong convexity lower curvature
Step below two over L stays stable
Descent Lemma via integral
Condition number kappa = L over mu
Eigenvalues = curvatures on perpendicular axes
Gradient Descent convergence analysis
Right side cover karo aur aage badhne se pehle har ek yaad karo.
f : R n → R ka saadhe alfaaz mein kya matlab hai?Ek location (n numbers ki list) leta hai, ek height number return karta hai.
x ⋆ aur f ⋆ kya hain?Lowest point ki location, aur wahan ki height.
∥ v ∥ kaise compute karte hain aur yeh kya picture karta hai?v 1 2 + ⋯ + v n 2 ; arrow ki straight-line length.
Topic ko ∥ ⋅ ∥ kyun chahiye? Shrinking gap ∥ x k − x ⋆ ∥ measure karne ke liye.
u ⊤ v geometrically kya measure karta hai?Do arrows kitna same direction mein point karte hain: ∥ u ∥∥ v ∥ cos θ .
Cauchy–Schwarz state karo. ∣ u ⊤ v ∣ ≤ ∥ u ∥∥ v ∥ , equality jab aligned ho.
∇ f kya hai aur kahan point karta hai?Partials ka vector; floor plane mein steepest-uphill arrow.
Hum − ∇ f ke along step kyun lete hain? Directional slope ∇ f ⊤ u tab sabse zyada negative hoti hai jab u , ∇ f ka virodh kare (Cauchy–Schwarz).
η kya hai, aur η > 2/ L hone pe kya hota hai?Step size; factor ∣1 − η L ∣ > 1 ho jaata hai, toh distance-to-bottom barta hai aur GD diverge karta hai.
2 1 L x 2 bowl pe η = 1/ L special kyun hai?Factor 1 − η L , 0 ho jaata hai — ek step mein bottom reach karta hai.
Hessian ∇ 2 f kya hai? Second derivatives ka matrix — landscape ki curvature/bendiness.
"Positive semidefinite" (M ⪰ 0 ) ka matlab kya hai? v ⊤ M v ≥ 0 har v ke liye — har direction mein upar curve karta hai (kabhi neeche nahi).
∇ 2 f ⪯ L I ka saadhe alfaaz mein kya matlab hai?L I − ∇ 2 f ⪰ 0 ; curvature kabhi L se zyada nahi kisi bhi direction mein.
L -smoothness define karo.∥∇ f ( x ) − ∇ f ( y ) ∥ ≤ L ∥ x − y ∥ — gradient L -Lipschitz hai.
μ -strong convexity define karo.∇ 2 f ⪰ μ I with μ > 0 ; kam se kam μ -parabola ki tarah upar curve karta hai.
Hessian ka eigenvalue geometrically kya hai? Uske perpendicular eigenvector axes mein se ek ke along curvature.
κ kya hai aur yeh kya picture karta hai?L / μ ≥ 1 ; valley kitni stretched hai (round bowl vs thin ravine).
Descent Lemma state karo aur uska kaam bolo. f ( y ) ≤ f ( x ) + ∇ f ( x ) ⊤ ( y − x ) + 2 L ∥ y − x ∥ 2 ; GD har step mein is upper bowl ko minimize karta hai.
Rate ρ kya hai? Har step mein rakhi gayi error ka fraction; chhota matlab zyada tez (ρ ⋆ = κ + 1 κ − 1 ).
E [ g k ] = ∇ f ( x k ) kya kehta hai?Noisy SGD gradient average mein sach wala gradient hai.