Implement numerically stable softmax by shifting each row by its maximum before exponentiating.
Required APIdef stable_softmax(values):
return probabilitiesBehaviorThink through the mechanism first if you want the extra reasoning step. It never blocks the editor.
stable_softmax([0.0, 0.0])equal evidence produces equal probability
stable_softmax([10.0])one class always receives all probability
2 hidden edge tests run after the visible contract passes.
Run Tests to see the contract verdicts here.