Optimizers practice problems

17 problems · 0 solved

An optimizer decides how to change the weights once the gradients are known. Plain gradient descent takes a step straight downhill, while modern optimizers keep running averages to smooth noise and adapt the step size per parameter. Momentum is like a ball rolling down a hill that keeps some speed from earlier steps. These problems ask you to implement the optimizers and schedules used in practice. You will add momentum to gradient descent, take a Nesterov step, take a centered RMSProp step, implement one step of Adam, minimise a quadratic with AdamW, bias correction and a no-decay mask, run the sign-based Lion optimizer, wrap an optimizer with Lookahead, compute Adafactor's factored second moment, clip gradients by global norm, compute the Noam warmup schedule, and combine AdamW with linear warmup and cosine decay. Start with the Easy problems on momentum, clipping and warmup. Then do Adam, RMSProp and Lion, and finish with AdamW schedules and Adafactor. Interviewers often ask how AdamW differs from Adam or why warmup helps, and these details decide whether a large training run converges or diverges.

Easy 7

Medium 7

Hard 3

Related topics

All practice problems