All problems
Linear Epsilon Schedule
Problem
Compute the epsilon used at step t under a linear decay schedule.
Epsilon decreases linearly from start to end over decay_steps steps and then stays at end. If decay_steps is not positive or t is at least decay_steps, return end.
Hint
The fraction t / decay_steps is the interpolation weight between start and end.
Test cases
case 1
in: [0,1,0.1,100]
expected: 1
case 2
in: [50,1,0.1,100]
expected: 0.55
case 3
in: [100,1,0.1,100]
expected: 0.1
case 4
in: [200,1,0.1,100]
expected: 0.1
case 5
in: [30,0.9,0,60]
expected: 0.45
Starter codePython
def linear_epsilon(t, start, end, decay_steps):
# Your code here
pass5 test cases · run your code against them in the editor