A primitive to perform batch normalization.
Both forward and backward propagation primitives support in-place operation; that is, src and dst can refer to the same memory for forward propagation, and diff_dst and diff_src can refer to the same memory for backward propagation.
The batch normalization primitives computations can be controlled by specifying different dnnl::normalization_flags values. For example, batch normalization can compute the mean and variance on its own or take them as inputs. It can either perform scaling and shifting using gamma and beta parameters or not. Optionally, it can also perform a fused ReLU, which in case of training would also require a workspace.
- See also
- Batch Normalization in developer guide
◆ dnnl_batch_normalization_forward_desc_init()
Initializes a descriptor for a batch normalization forward propagation primitive.
- Note
- In-place operation is supported: the dst can refer to the same memory as the src.
- Parameters
-
- Returns
- dnnl_success on success and a status describing the error otherwise.
◆ dnnl_batch_normalization_backward_desc_init()
Initializes a descriptor for a batch normalization backward propagation primitive.
- Note
- In-place operation is supported: the diff_dst can refer to the same memory as the diff_src.
- Parameters
-
bnrm_desc | Output descriptor for batch normalization primitive. |
prop_kind | Propagation kind. Possible values are dnnl_backward_data and dnnl_backward (diffs for all parameters are computed in this case). |
diff_data_desc | Diff source and diff destination memory descriptor. |
data_desc | Source memory descriptor. |
epsilon | Batch normalization epsilon parameter. |
flags | Batch normalization flags (dnnl_normalization_flags_t). |
- Returns
- dnnl_success on success and a status describing the error otherwise.