All problems
Co-Teaching Sample Selection
Problem
Select the cleanest samples for co-teaching.
Compute the mean loss of the two models per sample, keep int(len * ratio) samples with the smallest mean loss (ties by smaller index) and return the kept indices sorted ascending.
Test cases
case 1
in: [[0.1,0.5,0.2,0.9],[0.2,0.1,0.4,0.3],0.5]
expected: [0,1]
case 2
in: [[0.4,0.1,0.3],[0.4,0.2,0.1],0.34]
expected: [1]
case 3
in: [[0.5,0.5],[0.5,0.5],1]
expected: [0,1]
Starter codePython
def coteaching_select(loss_a, loss_b, ratio):
# Your code here
pass3 test cases · run your code against them in the editor