pub fn ns_softmax(x: &[f64]) -> Vec<f64>
Softmax of a slice: normalised exponentials exp(x_i) / Σ exp(x_j).
exp(x_i) / Σ exp(x_j)
Uses the max-subtraction trick for numerical stability. Returns an empty Vec when x is empty.
Vec
x