BatchNormalization - version 6#

This page documents version 6 of operator BatchNormalization. See BatchNormalization for the latest version (since version 15).

  • Domain: ai.onnx

  • Since version: 6

Carries out batch normalization as described in the paper https://arxiv.org/abs/1502.03167. Depending on the mode it is being run, there are multiple cases for the number of outputs, which we list below:

Output case #1: Y, mean, var, saved_mean, saved_var (training mode) Output case #2: Y (test mode)

Inputs

  • X (T): Input data tensor from the previous operator; dimensions for image case are (N x C x H x W), where N is the batch size, C is the number of channels, and H and W are the height and the width of the data. For non image case, the dimensions are in the form of (N x C x D1 x D2 … Dn), where N is the batch size.

  • scale (T): The scale as a 1-dimensional tensor of size C to be applied to the output.

  • B (T): The bias as a 1-dimensional tensor of size C to be applied to the output.

  • mean (T): The running mean (training) or the estimated mean (testing) as a 1-dimensional tensor of size C.

  • var (T): The running variance (training) or the estimated variance (testing) as a 1-dimensional tensor of size C.

Outputs

  • Y (T): The output tensor of the same shape as X.

  • mean (T): The running mean after the BatchNormalization operator. Must be in-place with the input mean. Should not be used for testing.

  • var (T): The running variance after the BatchNormalization operator. Must be in-place with the input var. Should not be used for testing.

  • saved_mean (T): Saved mean used during training to speed up gradient computation. Should not be used for testing.

  • saved_var (T): Saved variance used during training to speed up gradient computation. Should not be used for testing.

Type Constraints

  • T: Constrain input and output types to float tensors. Allowed types: tensor(double), tensor(float), tensor(float16).

Differences with previous version (1)#

SchemaDiff: BatchNormalization (domain 'ai.onnx')

  • old version: 1

  • new version: 6

  • breaking: no