Skip to content
DeepForgeby svx
All problems
EasyComputer Visioncv-276

Self-Training Round

Problem

Produce hard pseudo-labels for one self-training round.

For each probability vector, output the argmax class (smallest index on ties) when the maximum probability is at least threshold, otherwise -1.

Test cases

case 1
in: [[[0.9,0.1],[0.2,0.8],[0.4,0.5]],0.6]
expected: [0,1,-1]
case 2
in: [[[0.6,0.4]],0.5]
expected: [0]
case 3
in: [[[0.1,0.2],[0.7,0.3]],0.6]
expected: [-1,0]
Starter codePython
def self_training_labels(probs, threshold):
    # Your code here
    pass

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