Skip to main content

batch_norm

Function batch_norm 

Source
pub fn batch_norm<const D: usize>(
    input: Tensor<D>,
    gamma: Tensor<1>,
    beta: Tensor<1>,
    mean: Tensor<1>,
    variance: Tensor<1>,
    epsilon: f64,
) -> Tensor<D>
Expand description

Applies batch normalization using explicitly supplied channel statistics.

input has shape [batch, channels, ...]; gamma, beta, mean, and variance each have shape [channels].

This function doesn’t calculate or update statistics. Callers may supply running statistics for inference or batch statistics calculated by a training path.