Compute the cosine-annealed learning rate at step t of T: ηmin+21(η0−ηmin)(1+cos(πt/T)). t is clamped to [0,T]; if T <= 0 the rate is min_lr.
Implement solve(lr0, min_lr, t, T).
Returns. Return the learning rate as a float, starting at lr0 for t=0 and ending at min_lr for t=T.
Example 1
Input:
solve(5.0, 1.0, 0, 10)
Output:
5.0
Example 2
Input:
solve(5.0, 1.0, 5, 10)
Output:
3.0
Example 3
Input:
solve(5.0, 1.0, 10, 10)
Output:
1.0
No results yet
Run your code to check it against the examples, or submit to run every test.