I started with the mechanics, SGD is just gradient times learning rate, with momentum as an optional velocity term that smooths out the updates.
Start by defining both optimizers and their update rules, then compare them across memory, convergence, and practical use cases. Emphasize that the choice depends on the problem, data, and constraints, and relate it to real-world scenarios like Netflix's recommendation systems.
Pro tip: Mention that Adam's adaptive learning rates can lead to poor generalization compared to SGD with momentum, and that switching from Adam to SGD can sometimes improve final performance. Also, note that Adam is often preferred for sparse gradients and quick prototyping, while SGD is favored for fine-tuning and when memory is limited.
Briefly explain what SGD and Adam are, including their full names and core idea.
Describe how each optimizer updates weights: SGD uses a fixed learning rate times gradient (with optional momentum), while Adam uses adaptive learning rates based on first and second moment estimates.
State that SGD requires O(1) memory per parameter (or O(n) for momentum), while Adam requires O(2n) for moment estimates, making it more memory-intensive.
Explain that SGD with momentum often converges to sharper minima but can be slower and sensitive to learning rate; Adam converges faster initially but may generalize worse and can get stuck in sharp minima.
Give scenarios: use Adam for sparse gradients, quick experimentation, or when memory is abundant; use SGD for fine-tuning, limited memory, or when best generalization is needed.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.