NumPy allowed · plain Python earns 10 bonus points
Computed matrix × vector transformation
Implement cosine-annealing learning rate decay, one of the most widely-used real LR schedules for training large models.
Implement cosine_annealing_lr(step, total_steps, base_lr, min_lr=0.0). Return min_lr + 0.5*(base_lr-min_lr)*(1 + cos(pi*step/total_steps)). Clamp step to total_steps if it exceeds it (so the schedule never goes below min_lr).
cosine_annealing_lr(step: int, total_steps: int, base_lr: float, min_lr: float = 0.0) -> float