← Projectsclassifier-lab / L3Sigmoid + Log Loss~16 min
one move: measure behavior
Implement numerically stable softmax by shifting each row by its maximum before exponentiating. In the Classifier Lab system, implement this level as a deterministic contract before composing it with the next service.
Required API
def stable_softmax(values):
return probabilities
Behavior
shift by the row maximum
normalize exponentials by their sum
return probabilities that sum to one
Examples — tap to reveal
Constraints
Use only the Python standard library.
Return deterministic values so every run can be compared with the contract.