pub fn softmax(x: &[f64]) -> Vec<f64>
Softmax of a slice: exp(x_i) / sum(exp(x_j)).
exp(x_i) / sum(exp(x_j))
Numerically stable implementation via max-subtraction.