5.6.10 · D1 · HinglishMachine Learning (Aerospace Applications)

FoundationsBatch, mini-batch, stochastic gradient descent

2,710 words12 min read↑ Read in English

5.6.10 · D1 · Coding › Machine Learning (Aerospace Applications) › Batch, mini-batch, stochastic gradient descent

Parent note ko aaram se padhne se pehle, tumhe har us symbol ko kamana hoga jo woh tumhare saamne rakhta hai. Hum unhe ek ek karke build karte hain, har ek pichle wale par tikha hua. Yahan kuch bhi assume nahi kiya ki tumne calculus ya statistics dekha hai — hum ek picture se shuru karte hain.


1. Training data: , ,

Subscript ek name tag hai, multiplication nahi. ka matlab hai "5th input," bilkul waise jaise "chair #5" ek row mein ek kursi ki taraf point karta hai.

Figure — Batch, mini-batch, stochastic gradient descent

Figure dekho: har dot ek pair hai jo grid par plot kiya gaya hai. simply dots ki sankhya hai. Woh pura dots ka cloud sara data hai — woh cheez jise Batch GD ek baar mein dekhta hai.


2. Model aur uske knobs: aur

ko radio ke dial ki tarah socho. Use ghoomane se jo suno badal jata hai; yahan, ko ghoomane se model kya predict karta hai badal jata hai. Learning = sahi dial position dhundna.


3. Ghalat hone ko measure karna: loss aur

Squared kyun? Do reasons, dono visual:

  1. Squaring har error ko positive banata hai (upar ki miss aur neeche ki miss dono "bura" count hota hai).
  2. Square ek smooth U-shaped bowl hai — aur ek bowl ka ek clear bottom hota hai jahan tum roll karke ja sakte ho. Figure dekho.
Figure — Batch, mini-batch, stochastic gradient descent

ko zor se padho: "jodo, ke liye 1 se tak." Saamne us bade sum ko ek average mein badal deta hai. Toh hai "abhi average par, model kitna galat hai?"


4. Dhal: gradient aur derivative

Ab key sawal: kisi par khade hote hue, landscape par konsi taraf neeche hai? "Konsi taraf aur kitni steeply ek curve jata hai" ka jawab dene ka tool derivative hai.

Figure — Batch, mini-batch, stochastic gradient descent

Figure mein tangent lines dekho: derivative us line ki tilt hai jo curve ko sirf kiss karti hai. Zyada tilt = bada number.

Yahi result hai jo parent ke Worked Example 1 mein use hota hai — ab tum jaante ho kahaan se aata hai, aur kyun koi nahi bachta.

Figure — Batch, mini-batch, stochastic gradient descent

Figure dekho: do-knob bowl par, do partial slopes (ek per axis) do components hain; unhe tip-to-tail join karo aur diagonal arrow hai — true steepest-uphill direction. Neeche jaane ke liye, hum arrow ke opposite jaate hain: .


5. Step: learning rate aur update arrow

Sab kuch milake, ideal update hai: Arrow ka matlab hai "replace with" ko naya value assign karo. Yeh koi equation nahi hai; yeh ek action hai.


6. Estimates aur averages: , , aur

Figure — Batch, mini-batch, stochastic gradient descent

Figure dekho: usi bowl par teen descent paths — wobbly wala (SGD, ), medium wala (mini-batch), smooth wala (Batch). Same destination, alag amounts of jitter, exactly jaisa predict karta hai.


7. Bookkeeping words: epoch, batch size

Woh hi parent ke Worked Example 3 ka poora content hai: updates per epoch.


Yeh foundations topic ko kaise feed karte hain

Dependencies ki chain ko upar se neeche padho — har box is page ki ek foundation hai, aur tum koi link skip nahi kar sakte. Data define karta hai ki model ko kis cheez ke against judge kiya jata hai; woh judgement loss hai, landscape mein average kiya gaya; ki slope (derivative → gradient ) batati hai konsi taraf neeche hai; learning rate step ka size decide karta hai; aur aakhirkar estimate (apne expectation aur variance ke saath) woh hai jo ideal step ko teen real algorithms mein badal deta hai.

Training data x_i y_i and count N

Model f with knobs theta

Loss L_i one examples wrongness

Total loss J the landscape

Derivative and gradient nabla J the slope

Learning rate eta and step delta theta

Update rule theta minus eta g-hat

Estimate g-hat expectation and variance

Batch Mini-batch and SGD

Map use karo apna reading order check karne ke liye: agar upar koi bhi box abhi bhi fuzzy lagta hai, toh exactly wahan re-read karo teen descent methods par jaane se pehle. In ideas ke aage kahan jaate hain iske liye, dekho Gradient Descent, Learning Rate and Schedules, Loss Functions, Momentum and Adam, Saddle Points and Non-Convex Optimization, Bias-Variance Tradeoff, aur Backpropagation (woh machine jo actually real networks ke liye compute karta hai).


Equipment checklist

Self-test: kya tum reveal karne se pehle har jawab bol sakte ho?

mein subscript ka matlab kya hai?
Ek name tag / counter jo -ve training example ko pick karta hai — multiplication nahi.
kya represent karta hai?
Model ke adjustable knobs (parameters) jo hum loss reduce karne ke liye tune karte hain.
Squared loss bowl ki shape kyun hota hai?
Squaring har error ko positive aur smooth banata hai, ek clear lowest point deta hai jis par descend kar sako.
tumhe kya karne ko kehta hai?
= 1 se tak ke term ko add karo.
Derivative physically kya batata hai?
Tumhari current jagah par loss curve ki slope — konsi taraf aur kitni steeply woh tilt karta hai.
Squared loss ke gradient mein koi kyun nahi bachta?
Power rule neeche laata hai jo cancel kar deta hai (); precisely isi ke liye choose kiya gaya tha.
Partial derivative kya hai?
ki slope jab tum sirf knob wiggle karo aur baaki sab knobs still rakho.
Gradient partial derivatives se kaise banta hai?
Har knob ke partial derivative ko ek column mein stack karke — woh stack hi arrow hai.
Gradient kis direction mein point karta hai?
Uphill (steepest increase); hum iske opposite move karte hain, , neeche jaane ke liye.
kya role play karta hai?
Step size (learning rate) — har update mein kitna door move karte ho.
Real update ki jagah kyun use karta hai?
True gradient expensive hai (sab terms); ek subset se sasta estimate hai, aur teen methods sirf is baat mein alag hain ki kaise build hota hai.
mein arrow ka matlab kya hai?
" ko naye value se replace karo" — ek assignment/action, equality nahi.
mein hat kya signify karta hai?
Yeh true gradient ka ek estimate hai, data ke subset se build kiya gaya.
ka words mein matlab kya hai?
Average par, ek randomly chosen example ka gradient true gradient ke barabar hota hai — estimate unbiased hai.
Gradient estimate ka variance par kaise depend karta hai?
Yeh se shrink hota hai: bada batch, kam jitter.
samples aur batch size ke saath ek epoch mein kitne updates?
.