How weights actually move
Optimizers determine how weights update given gradients. Choice and hyperparameters significantly affect training speed and final quality.
| Optimizer | Best for | Notes |
|---|---|---|
| SGD + momentum | Large-scale vision, when you tune LR | Often achieves best final accuracy with proper tuning |
| Adam | General default, NLP, early experiments | Robust, fast convergence, slightly worse peak than tuned SGD |
| AdamW | Transformers, large models | Decoupled weight decay — cleaner regularization |
| RMSprop | RNNs, non-stationary objectives | Older default before Adam dominated |
Learning rate schedules almost always help. The classic pattern: warmup for a few epochs (linear from 0 to base_lr), then cosine decay back toward 0. CosineDecay with optional warmup_steps is built into Keras 3.