All problems
Curriculum Mixing Ratio
Problem
Return a linearly ramped mixing ratio: start at step 0, reach end at step = warmup, and stay clamped to [start, end] afterwards. A non-positive warmup jumps straight to end.
Test cases
case 1
in: [0,100,0.1,0.9]
expected: 0.1
case 2
in: [50,100,0.1,0.9]
expected: 0.5
case 3
in: [100,100,0.1,0.9]
expected: 0.9
case 4
in: [150,100,0.1,0.9]
expected: 0.9
case 5
in: [10,0,0.2,0.8]
expected: 0.8
Starter codePython
def curriculum_ratio(step, warmup, start, end):
# Your code here
pass5 test cases · run your code against them in the editor