Skip to main content

softmax

Function softmax 

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

Softmax of a slice: exp(x_i) / sum(exp(x_j)).

Numerically stable implementation via max-subtraction.