pub fn softmax(logits: &[f64]) -> Vec<f64>
Compute softmax with the log-sum-exp trick for numerical stability.
Returns a probability vector that sums to 1.0 (unless the input is empty).