Skip to content
DeepForgeby svx
All problems
EasyComputer Visioncv-345

Mixup Label Blend

Problem

Interpolate two label distributions with the mixup lambda.

Return lam * y_a + (1 - lam) * y_b elementwise, rounded to 4 decimal places, where lam is the mixing weight applied to the first label vector.

Test cases

case 1
in: [[1,0],[0,1],0.7]
expected: [0.7,0.3]
case 2
in: [[0.2,0.8],[0.9,0.1],0.25]
expected: [0.725,0.275]
case 3
in: [[1,0,0],[0,0,1],1]
expected: [1,0,0]
Starter codePython
def mixup_labels(y_a, y_b, lam):
    # Your code here
    pass

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