Skip to content
DeepForgeby svx
All problems
MediumComputer Visioncv-279

TrivialAugment Pick

Problem

Pick a random operation and magnitude for TrivialAugment.

Seed the random module, then draw the operation index with randrange(num_ops) and the magnitude index with randrange(num_magnitudes). Return [op_index, magnitude_index].

Test cases

case 1
in: [4,3,0]
expected: [3,1]
case 2
in: [4,3,7]
expected: [2,0]
case 3
in: [2,5,1]
expected: [0,4]
Starter codePython
def trivial_augment_pick(num_ops, num_magnitudes, seed):
    # Your code here
    pass

3 test cases · run your code against them in the editor