TorchedUp
ProblemsPremium
TorchedUp
Cosine Annealing LREasy
ProblemsPremium

Cosine Annealing Learning Rate

Implement the cosine annealing learning rate schedule.

Signature: def cosine_lr(t: int, T: int, lr_max: float, lr_min: float = 0.0) -> float

Return the learning rate at step t given total steps T.

Math

Asked at

Python (numpy)0/3 runs today

Test Results

○t=0 start
○t=T/2 midpoint
○t=T end🔒 Premium
Advertisement