Main Content

Normalize across grouped subsets of channels for each observation independently

The group normalization operation normalizes the input data
across grouped subsets of channels for each observation independently. To speed up training of
the convolutional neural network and reduce the sensitivity to network initialization, use group
normalization between convolution and nonlinear operations such as `relu`

.

After normalization, the operation shifts the input by a learnable offset *β* and scales it by a learnable scale factor *γ*.

The `groupnorm`

function applies the group normalization operation to
`dlarray`

data.
Using `dlarray`

objects makes working with high
dimensional data easier by allowing you to label the dimensions. For example, you can label
which dimensions correspond to spatial, time, channel, and batch dimensions using the
`'S'`

, `'T'`

, `'C'`

, and
`'B'`

labels, respectively. For unspecified and other dimensions, use the
`'U'`

label. For `dlarray`

object functions that operate
over particular dimensions, you can specify the dimension labels by formatting the
`dlarray`

object directly, or by using the `'DataFormat'`

option.

**Note**

To apply group normalization within a `layerGraph`

object
or `Layer`

array, use
`groupNormalizationLayer`

.

applies the group normalization operation to the input data `dlY`

= groupnorm(`dlX`

,`numGroups`

,`offset`

,`scaleFactor`

)`dlX`

using
the specified number of groups and transforms using the specified offset and scale
factor.

The function normalizes over grouped subsets of the `'C'`

(channel)
dimension and the `'S'`

(spatial), `'T'`

(time), and
`'U'`

(unspecified) dimensions of `dlX`

for each
observation in the `'B'`

(batch) dimension, independently.

For unformatted input data, use the `'DataFormat'`

option.

applies the group normalization operation to the unformatted `dlY`

= groupnorm(`dlX`

,`numGroups`

,`offset`

,`scaleFactor`

,'DataFormat',FMT)`dlarray`

object
`dlX`

with format specified by `FMT`

using any of the
previous syntaxes. The output `dlY`

is an unformatted
`dlarray`

object with dimensions in the same order as
`dlX`

. For example, `'DataFormat','SSCB'`

specifies
data for 2-D image input with format `'SSCB'`

(spatial, spatial, channel,
batch).

specifies options using one or more name-value pair arguments in addition to the input
arguments in previous syntaxes. For example, `dlY`

= groupnorm(___`Name,Value`

)`'Epsilon',3e-5`

sets the
variance offset to `3e-5`

.

The group normalization operation normalizes the elements
*x _{i}* of the input by first calculating the mean

$${\widehat{x}}_{i}=\frac{{x}_{i}-{\mu}_{G}}{\sqrt{{\sigma}_{G}^{2}+\epsilon}},$$

where *ϵ* is a constant that improves numerical
stability when the variance is very small. To allow for the possibility that inputs with
zero mean and unit variance are not optimal for the operations that follow group
normalization, the group normalization operation further shifts and scales the activations
using the transformation

$${y}_{i}=\gamma {\widehat{x}}_{i}+\beta ,$$

where the offset *β* and scale factor
*γ* are learnable parameters that are updated during network
training.

`batchnorm`

| `dlarray`

| `dlconv`

| `dlfeval`

| `dlgradient`

| `fullyconnect`

| `instancenorm`

| `layernorm`

| `relu`