Stochastic Gradient Descent › The SGD Update Rule

Michael BrenndoerferApril 30, 20251 min read
Language AI HandbookAll chapters
Part 10 of 67Neural Network Foundations
Chapter 66Stochastic Gradient Descent › The SGD Update Rule
Reading section 3 of 16 · The SGD Update Rule · 1 minSection 3 of 16 · 1 min

Book contents

Section 3 of 16 · 1 min read

Stochastic Gradient Descent › The SGD Update RuleOne section · Sections in this chapter3 / 16 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

The SGD update rule is simple. At iteration tt, we randomly select example index iti_t and update:

θt+1=θt−η∇θℓ(θt;xit,yit)\boldsymbol{\theta}_{t+1} = \boldsymbol{\theta}_t - \eta \nabla_{\boldsymbol{\theta}} \ell(\boldsymbol{\theta}_t; \mathbf{x}_{i_t}, y_{i_t})

where:

  • θt+1\boldsymbol{\theta}_{t+1}: the updated parameters after step tt
  • θt\boldsymbol{\theta}_t: the current parameters before step tt
  • η\eta: the learning rate (a fixed positive scalar, or one that changes according to a schedule)
  • iti_t: a uniformly random index drawn at iteration tt
  • ∇θℓ(θt;xit,yit)\nabla_{\boldsymbol{\theta}} \ell(\boldsymbol{\theta}_t; \mathbf{x}_{i_t}, y_{i_t}): the gradient of the loss on the single selected example

In practice, we almost never sample a single example at a time. We use mini-batches.