aNet.ai
Machine Learning/Learning path
0day streak0XP · Lv 1
← 4. Learning as an Optimization Problem
Lesson 9 of 12 9 min · 133 words

Stochastic gradient descent

Updating from one example at a time: cheap but noisy.

Stochastic gradient descent (SGD) uses the gradient of the loss on a single random example per step: . On average this equals the full gradient, so it points the right way in expectation.

Each step is times cheaper, so SGD makes progress long before full-batch GD has finished a single step. The price is noise: the loss zig-zags instead of falling smoothly.

The noise can help — it can bounce the parameters out of shallow local minima and saddle points — but near the end it stops precise convergence, so the learning rate is usually decreased over time (a learning-rate schedule).

Formula to remember

Gradient descent

Step against the gradient with learning rate η.

Quick check · +5 XP

SGD with batch size 1 compared to full-batch GD is…

Practice this topic
Saved in this browser as you type.
aNet.ai · Introduction to Machine Learning · NewUU course outlineProgress saved in this browser