Stochastic gradient descent (SGD)

Level AdvancedDifficulty ★★★★★Application⌖ Open in the map

What is it?

Use the gradient of a small random batch instead of the whole dataset: a noisy but unbiased estimate, thousands of times cheaper. The noise even helps escape saddles and sharp minima.

Formulas

θk+1=θk−ηk 1∣Bk∣∑i∈Bk∇ℓi(θk)\theta_{k+1} = \theta_k - \eta_k\,\frac{1}{|B_k|}\sum_{i\in B_k}\nabla\ell_i(\theta_k)
∑kηk=∞,∑kηk2<∞\sum_k\eta_k = \infty, \qquad \sum_k\eta_k^2 < \infty
Robbins–Monro step-size conditions for convergence

The mathematics behind it

  • Expectation★★★★★fundamental

    A mini-batch gradient is an unbiased estimate of the expected gradient.

  • Variance★★★★★frequent

    Gradient noise variance falls as 1/∣B∣1/|B|; it sets the useful learning rate and batch size.

Where is it used?

Computing topics reachable from here, through the chain of ideas that leads to them:

What depends on it

This page has the essentials. A fuller treatment (intuition, formal definition, worked example) is on the way.

↑ ↓ to navigate · ↵ · Esc