Normalizes per channel over the BATCH axis -- and, for conv-shaped inputs, over
every spatial position as well -- the defining property of batch normalization.
During training the statistics come from the current batch; at inference time
the stored running estimates are used instead, so a prediction depends only on
the sample itself and not on which other samples share its batch. Mirrors
ag_batch_norm() in the autograd API.
nn_build_batch_norm(ctx, input_tensor, layer, training = TRUE)A ggml_tensor with batch-normalized, scaled and shifted values.
Logical; use batch statistics (TRUE) or running estimates (FALSE).
For a flat [features, batch] input the batch axis is ne[1].
Reductions in ggml run along ne[0], hence the transposes: they move the
batch axis into reduction position and back. Conv-shaped inputs need a
different rearrangement and are handled by nn_bn_normalize_conv().