Visible to Intel only — GUID: GUID-E5536833-F164-48FD-94ED-32C11F316FDA
Visible to Intel only — GUID: GUID-E5536833-F164-48FD-94ED-32C11F316FDA
Batch Normalization
Overview
A primitive to perform batch normalization. More…
// structs struct dnnl::batch_normalization_backward; struct dnnl::batch_normalization_forward; // global functions dnnl_status_t DNNL_API dnnl_batch_normalization_forward_primitive_desc_create( dnnl_primitive_desc_t* primitive_desc, dnnl_engine_t engine, dnnl_prop_kind_t prop_kind, const_dnnl_memory_desc_t src_desc, const_dnnl_memory_desc_t dst_desc, float epsilon, unsigned flags, const_dnnl_primitive_attr_t attr ); dnnl_status_t DNNL_API dnnl_batch_normalization_backward_primitive_desc_create( dnnl_primitive_desc_t* primitive_desc, dnnl_engine_t engine, dnnl_prop_kind_t prop_kind, const_dnnl_memory_desc_t diff_src_desc, const_dnnl_memory_desc_t diff_dst_desc, const_dnnl_memory_desc_t src_desc, float epsilon, unsigned flags, const_dnnl_primitive_desc_t hint_fwd_pd, const_dnnl_primitive_attr_t attr );
Detailed Documentation
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 forward propagation can be configured to either compute the mean and variance or take them as arguments. 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
Global Functions
dnnl_status_t DNNL_API dnnl_batch_normalization_forward_primitive_desc_create( dnnl_primitive_desc_t* primitive_desc, dnnl_engine_t engine, dnnl_prop_kind_t prop_kind, const_dnnl_memory_desc_t src_desc, const_dnnl_memory_desc_t dst_desc, float epsilon, unsigned flags, const_dnnl_primitive_attr_t attr )
Creates a primitive descriptor for a batch normalization forward propagation primitive.
Parameters:
primitive_desc |
Output primitive_descriptor. |
engine |
Engine to use. |
prop_kind |
Propagation kind. Possible values are dnnl_forward_training and dnnl_forward_inference. |
src_desc |
Source memory descriptor. |
dst_desc |
Destination memory descriptor. |
epsilon |
Batch normalization epsilon parameter. |
flags |
Batch normalization flags (dnnl_normalization_flags_t). |
attr |
Primitive attributes (can be NULL). |
Returns:
dnnl_success on success and a status describing the error otherwise.
dnnl_status_t DNNL_API dnnl_batch_normalization_backward_primitive_desc_create( dnnl_primitive_desc_t* primitive_desc, dnnl_engine_t engine, dnnl_prop_kind_t prop_kind, const_dnnl_memory_desc_t diff_src_desc, const_dnnl_memory_desc_t diff_dst_desc, const_dnnl_memory_desc_t src_desc, float epsilon, unsigned flags, const_dnnl_primitive_desc_t hint_fwd_pd, const_dnnl_primitive_attr_t attr )
Creates a primitive descriptor for a batch normalization backward propagation primitive.
Parameters:
primitive_desc |
Output primitive_descriptor. |
engine |
Engine to use. |
prop_kind |
Propagation kind. Possible values are dnnl_backward_data and dnnl_backward (diffs for all parameters are computed in this case). |
diff_src_desc |
Diff source memory descriptor. |
diff_dst_desc |
Diff destination memory descriptor. |
src_desc |
Source memory descriptor. |
epsilon |
Batch normalization epsilon parameter. |
flags |
Batch normalization flags (dnnl_normalization_flags_t). |
hint_fwd_pd |
Primitive descriptor for a respective forward propagation primitive. |
attr |
Primitive attributes (can be NULL). |
Returns:
dnnl_success on success and a status describing the error otherwise.