liveBook · Manning

Momentum

As explained in Deep Learning with R, Third Edition

Momentum is an optimization technique that incorporates previous parameter updates into the current update to improve movement through the optimization landscape.

Momentum improves stochastic gradient descent by combining the current gradient with previous parameter updates. The accumulated movement can increase convergence speed and help the optimization process pass through local minima. section 2.4.3

Momentum is useful because it:

  • Uses a physics-inspired velocity analogy: past gradients influence the next parameter movement. section 2.4.3
  • Updates parameters from both the current gradient and the previous velocity rather than the current gradient alone. section 2.4.3
  • Addresses slow convergence and getting stuck at local minima, although low-dimensional intuitions may not fully represent neural-network training. section 2.4.3

Naive momentum update

A basic implementation stores the previous velocity, combines it with the current gradient, updates the parameter, and then saves the new velocity for the next step. section 2.4.3

Figure 2.19 A local minimum and a global minimum
figure

Compare a local minimum with a global minimum to see why ordinary gradient descent can stop prematurely and why momentum may continue moving. section 2.4.3

How Deep Learning with R, Third Edition covers it

How deep it goes
Explains the velocity intuition and gives a naive parameter-update implementation, but does not cover tuning or framework-specific configuration.
Examples
Uses one-dimensional loss curves, a rolling-ball analogy, and pseudocode that tracks past velocity.
What it assumes
Assumes familiarity with stochastic gradient descent, gradients, parameters, learning rate, and loss landscapes.
What you can do after
Build it from scratch by retaining the previous velocity and combining it with each new gradient update.
How it connects
Connects stochastic gradient descent with optimizers, learning rate, gradients, local minima, and global minima.

Also explained in

Compare how 6 books explain momentum →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.