← Projectsclassifier-lab / L2Thresholded Prediction~14 min
one move: preserve an invariant
Build the deterministic decision at the end of a tiny MLP: choose the largest logit, with first-index tie breaking. In the Classifier Lab system, implement this level as a deterministic contract before composing it with the next service.
Required API
def predict_digit(logits):
return class_index
Behavior
scan every class score
return the index rather than the score
keep the earliest class on a tie
Examples — tap to reveal
Constraints
Use only the Python standard library.
Return deterministic values so every run can be compared with the contract.