GroupNormalization
classtf_keras.layers.GroupNormalization(
groups=32,
axis=-1,
epsilon=0.001,
center=True,
scale=True,
beta_initializer="zeros",
gamma_initializer="ones",
beta_regularizer=None,
gamma_regularizer=None,
beta_constraint=None,
gamma_constraint=None,
**kwargs
)
Group normalization layer.
Group Normalization divides the channels into groups and computes within each group the mean and variance for normalization. Empirically, its accuracy is more stable than batch norm in a wide range of small batch sizes, if learning rate is adjusted linearly with batch sizes.
Relation to Layer Normalization: If the number of groups is set to 1, then this operation becomes nearly identical to Layer Normalization (see Layer Normalization docs for details).
Relation to Instance Normalization: If the number of groups is set to the input dimension (number of groups is equal to number of channels), then this operation becomes identical to Instance Normalization.
Arguments
32
.-1
is the last dimension in the
input. Defaults to -1
.beta
to normalized tensor. If False,
beta
is ignored. Defaults to True
.gamma
. If False, gamma
is not used.
When the next layer is linear (also e.g. nn.relu
), this can be
disabled since the scaling will be done by the next layer.
Defaults to True
.input_shape
(tuple of integers, does not include the samples axis) when using this
layer as the first layer in a model. # Output shape Same shape as input.Call arguments
Reference: - Yuxin Wu & Kaiming He, 2018