R/stability.R
softmax.Rd
Computes softmax(x)_i = exp(x_i) / sum(exp(x)) in a numerically stable way.
softmax(x)
A value object or numeric vector
A value object (or numeric) with softmax probabilities
Uses the identity softmax(x) = softmax(x - max(x)) to prevent overflow.