Adobe-inspired model-training pipeline changes its learning rate over the course of a training schedule. You need to calculate the cosine-decayed learning rate at a requested training step so the scheduler matches the experiment configuration.
Compute the cosine-annealed learning rate at step t of T: ηmin+21(ηmax−ηmin)(1+cos(πt/T)). Note the argument order (t, T, lr_max, lr_min). t is not clamped, so for t>T the cosine starts rising again.
Implement solve(t,T,lr_max,lr_min).
Returns. Return the learning rate as a Python float. T must be positive.
Example 1
Input:
solve(5, 10, 0.1, 0.0)
Output:
0.05
Example 2
Input:
solve(0, 10, 0.1, 0.01)
Output:
0.1
Example 3
Input:
solve(10, 10, 0.1, 0.01)
Output:
0.01
No results yet
Run your code to check it against the examples, or submit to run every test.