| nn_build_batch_norm | R Documentation |
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)
training |
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().
A ggml_tensor with batch-normalized, scaled and shifted values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.