Self-training uses a model's own confident predictions on unlabeled data as targets. Given probs, an (N, C) array of predicted class distributions for unlabeled points, implement:
select_pseudo_labels(probs, threshold): return (idx, labels), two lists: the indices whose largest probability is at least threshold, in increasing order, and their argmax classes (ties go to the smaller class index).
sharpen(probs, T): the temperature-sharpened distribution , normalised per row.
unlabeled_losses(probs, T): a dict of three batch-mean losses, natural log:
"self_training": online self-training with hard targets, where is the argmax."entropy": entropy minimisation, ."sharpened_ce": cross-entropy against the sharpened target treated as a constant, .Return each loss as a Python float. All probabilities in the tests are strictly positive.