Nadam
Nadam is an optimizer designed to make neural-network training feel less like stepping blindly downhill. It combines Adam’s ability to scale each parameter’s update by its own gradient history with Nesterov momentum’s habit of “looking ahead” before committing to a direction.
How its update is built
Nadam maintains the same two running summaries as Adam:
- First moment: a smoothed average of gradients, representing the persistent direction of improvement.
- Second moment: a smoothed average of squared gradients, measuring how large and variable each parameter’s gradients are.
After correcting these summaries for their initial bias, Adam divides the momentum-like direction by the square root of the squared-gradient estimate. This gives parameters with consistently large gradients smaller effective steps. Nadam modifies the first-moment part using Nesterov momentum: rather than relying only on the accumulated direction, it blends in a contribution from the current gradient as though the optimizer had first moved slightly in its momentum direction. The result is a more anticipatory update.
Why the look-ahead matters
Picture a loss surface with a long slope and a sharp turn. Plain momentum can build speed in the old direction and overshoot the turn. Nesterov-style momentum checks the terrain near where that speed would carry it, helping correct course earlier. In Nadam, this behavior is paired with Adam’s per-parameter scaling, which is valuable when different layers produce gradients on very different scales.
Training behavior in practice
Nadam is a reasonable drop-in choice for a dense or deep network whose loss descends but zigzags or plateaus under basic SGD. Its usual controls are the learning rate, momentum decay β₁, squared-gradient decay β₂, and numerical stability constant ε. A learning rate that is too high still makes loss spike or diverge; adaptivity does not remove that risk. Nadam also stores two extra tensors per trainable parameter, increasing optimizer memory roughly twofold beyond the model weights. Frameworks such as Keras expose it as keras.optimizers.Nadam; use explicit weight decay when regularization is needed rather than assuming the optimizer provides it automatically.
Nadam is an adaptive gradient optimizer that combines Adam’s per-parameter learning-rate scaling and momentum estimates with Nesterov momentum, which evaluates the momentum-adjusted direction before updating parameters. It uses running averages of gradients and squared gradients to produce bias-corrected, stable updates. Nadam can accelerate convergence and improve training responsiveness when gradients vary across parameters or iterations.
Imagine teaching a cyclist to steer down a winding road. You would not only look at where they are pointing now; you would also notice the direction they have been moving for the last few moments, then help them anticipate the next turn.
Nadam is a way of helping an AI learn that combines two useful habits: adapting its steps to each part of the network, and using its recent learning direction to look slightly ahead. This can make training smoother and less prone to wobbling, especially when the AI is learning from noisy or varied examples. In practice, Nadam helps a network adjust itself efficiently while it improves at tasks such as recognizing images or understanding text.