Skip to main content

softmax_array

Function softmax_array 

Source
pub fn softmax_array<T>(
    values: &ArrayBase<ViewRepr<&T>, Dim<[usize; 1]>>,
) -> ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>
where T: Float,
Expand description

Numerically stable softmax for an ndarray 1-D array.

Subtracts the maximum before exponentiation to prevent overflow.