Skip to content
Infinitesimal Dynamics home
Notebook: 0 XP

Optimization / Smooth optimization

Gradient Descent

Walk downhill one step at a time: the algorithm that trains nearly every neural network.

3 min read · 2 sections · 2 checks

Contents 3 sections
  1. §1The update rule
  2. §2Momentum
  3. ?Check yourself

By the end you can

  • State the gradient descent update
  • Explain the role of the learning rate
  • Describe momentum and why it helps in narrow valleys

Helps to know: Convexity

§1The update rule

The gradient points uphill, so step the other way:

xk+1=xk−η ∇f(xk)x_{k+1} = x_k - \eta\, \nabla f(x_k)

The learning rate η\eta is the step size. Too small and progress crawls; too large and the iterates overshoot, oscillate, or explode. For f(x)=a2x2f(x) = \tfrac{a}{2}x^2 the method converges exactly when 0<η<2/a0 < \eta < 2/a.

Preparing the instrument…
Fig. 1 Release the optimizer on different landscapes and compare plain descent with momentum.

§2Momentum

In a long narrow valley, plain descent zig-zags across the walls. Momentum keeps a running velocity, vk+1=βvk−η∇f(xk)v_{k+1} = \beta v_k - \eta \nabla f(x_k) and xk+1=xk+vk+1x_{k+1} = x_k + v_{k+1}, so consistent directions accumulate speed while oscillations cancel.

Check yourself

  1. Q1
    For f(x)=2x2f(x) = 2x^2, which learning rate makes gradient descent diverge?
  2. Q2
    Gradient descent moves in the direction of…