liveBook · Manning

Adam

As explained in Inside Deep Learning: Math, Algorithms, Models

An adaptive optimization algorithm that combines moment estimates with variance-based gradient normalization.

Adam, or adaptive moment estimation, extends SGD with momentum by tracking an exponential moving average of gradients and an approximate variance from squared gradients. It gives reliable directions more influence and scales down high-variance directions, often reducing learning-rate tuning. section 5.3.2

The implementation maps the ideas to two running quantities:

  • Use m instead of momentum velocity v, and β1 instead of the momentum weight μ; multiply the current gradient by (1 − β1) to form an exponential moving average. section 5.3.2
  • Track squared gradient values as an imperfect variance approximation, using elementwise operations to estimate how consistently each parameter direction behaves. section 5.3.2

GAN-specific Adam settings

GAN training uses separate AdamW optimizers for the generator and discriminator: learning rate 0.0001 with β1 = 0 and β2 = 0.9. Each optimizer updates its own network during alternating discriminator and generator steps. section 9.1.3

How Inside Deep Learning: Math, Algorithms, Models covers it

How deep it goes
Explains exponential moving averages and squared-gradient variance approximations, but omits a complete update derivation.
Examples
Demonstrates AdamW on a classifier and on a GAN with separate generator and discriminator optimizers.
What it assumes
Assumes familiarity with gradients and momentum, while introducing exponential averaging and variance estimation through optimizer notation.
What you can do after
Apply it via PyTorch, selecting defaults for ordinary training or separate low-rate settings for GAN optimization.
How it connects
Connects Adam to SGD with momentum, Nesterov momentum, exponential moving averages, variance, AdamW, and learning-rate schedules.

Also explained in

Compare how 7 books explain adam →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Inside Deep Learning: Math, Algorithms, Models. The section links point to the parts of the book it draws on.