All problems
RandAugment Magnitude Schedule
Problem
Build a linear magnitude schedule for a RandAugment policy.
Return num_ops magnitudes spaced evenly from mag_min to mag_max inclusive, rounded to 4 decimal places. When num_ops is 1 return [round(mag_max, 4)].
Test cases
case 1
in: [3,0,10]
expected: [0,5,10]
case 2
in: [2,1,3]
expected: [1,3]
case 3
in: [5,0,1]
expected: [0,0.25,0.5,0.75,1]
case 4
in: [1,0,10]
expected: [10]
Starter codePython
def randaug_magnitudes(num_ops, mag_min, mag_max):
# Your code here
pass4 test cases · run your code against them in the editor