A convolutional layer outputs a tensor of shape (N,C,H,W)=(8,12,16,16) (batch size, channels, height, width). Over which axes are the mean and variance computed, how many distinct (μ,σ2) pairs are computed per batch, and how many learnable scale and shift parameters (γ,β) exist (assuming one pair per channel) for (a) batch normalisation, (b) layer normalisation, (c) instance normalisation and (d) group normalisation with G=3 groups?

Deep learning, Normalisation
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you know the exact normalisation axes of BN, LN, IN and GN on 4-D CNN feature maps and why GN avoids BN’s small-batch failure.

Key idea

All four normalise (x−μ)/σ2+ϵ with 2C=24 per-channel (γ,β) parameters, but differ in which axes μ,σ2 pool over: BN pools (N,H,W) (12 stats); LN pools (C,H,W) (8 stats); IN pools (H,W) (96 stats); GN splits C=12 into G=3 groups of 4 channels and pools (C/G,H,W) (24 stats).

Steps

  1. Batch norm (BN): normalise over (N,H,W) (each channel across batch and space). Number of (μ,σ2) pairs =C=12, each averaged over 8×16×16=2,048 values; learnable params =2C=24.
  2. Layer norm (LN): normalise over (C,H,W) (each sample independently across all channels and pixels). Number of (μ,σ2) pairs =N=8, each over 12×16×16=3,072 values; learnable params =2C=24 (note: PyTorch’s LayerNorm over dimensions [C,H,W] uses 2CHW=6,144 parameters if element-wise affine scaling is chosen).
  3. Instance norm (IN): normalise over (H,W) (each sample and channel separately). Number of (μ,σ2) pairs =N⋅C=96, each over 16×16=256 values; learnable params =2C=24.
  4. Group norm (GN, G=3): reshape C=12 into (G,C/G)=(3,4) and normalise over (C/G,H,W). Number of (μ,σ2) pairs =N⋅G=24, each over 4×16×16=1,024 values; learnable params =2C=24.
  5. Batch-size effect: LN, IN and GN never pool over N, so unlike BN their statistics remain accurate when N=1 or 2 (common in object detection and segmentation).

Common mistakes

How long your answer should be

Half a page; 4–5 minutes (a compact table works well).

Last checked on 4 December 2026.

Read this

Previous in Deep learning: What are the per-parameter update rules for AdaGrad and RMSProp, why does AdaGrad’s effective step size decay towards zero in deep learning, and for a constant gradient gt=2 with base learning rate η=0.1, decay rate ρ=0.9 and stability constant ϵ=0, what are the effective learning rates after 100 steps under AdaGrad versus RMSProp (at steady state)?
Next in Deep learning: For binary classification with logit z∈R and target y∈{0,1}, evaluating −(ylog⁡σ(z)+(1−y)log⁡(1−σ(z))) naively can overflow e−z or take log⁡(0). How do you derive the numerically stable form max⁡(z,0)−zy+log⁡(1+e−∣z∣), and what value does it give at z=−2,y=1?