Skip to main content

ns_softmax

Function ns_softmax 

Source
pub fn ns_softmax(x: &[f64]) -> Vec<f64>
Expand description

Softmax of a slice: normalised exponentials exp(x_i) / Σ exp(x_j).

Uses the max-subtraction trick for numerical stability. Returns an empty Vec when x is empty.