Warmup + Cosine Learning Rate

Implement a learning-rate schedule with linear warmup followed by cosine decay. A free ML coding interview task on NudgeCode: write it in Python and check it with tests in your browser. Easy · Optimization, Learning Rate.

Implement a zero-based schedule: linear warmup from base_lr/warmup_steps to base_lr, then half-cosine decay to min_lr. Clamp steps beyond total_steps at min_lr.