AICurious Logo

What is: Batch Normalization?

SourceBatch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift
Year2000
Data SourceCC BY-SA - https://paperswithcode.com

Batch Normalization aims to reduce internal covariate shift, and in doing so aims to accelerate the training of deep neural nets. It accomplishes this via a normalization step that fixes the means and variances of layer inputs. Batch Normalization also has a beneficial effect on the gradient flow through the network, by reducing the dependence of gradients on the scale of the parameters or of their initial values. This allows for use of much higher learning rates without the risk of divergence. Furthermore, batch normalization regularizes the model and reduces the need for Dropout.

We apply a batch normalization layer as follows for a minibatch B\mathcal{B}:

μ_B=1mm_i=1x_i\mu\_{\mathcal{B}} = \frac{1}{m}\sum^{m}\_{i=1}x\_{i}

σ2_B=1mm_i=1(x_iμ_B)2\sigma^{2}\_{\mathcal{B}} = \frac{1}{m}\sum^{m}\_{i=1}\left(x\_{i}-\mu\_{\mathcal{B}}\right)^{2}

x^_i=x_iμ_Bσ2_B+ϵ\hat{x}\_{i} = \frac{x\_{i} - \mu\_{\mathcal{B}}}{\sqrt{\sigma^{2}\_{\mathcal{B}}+\epsilon}}

y_i=γx^_i+β=BN_γ,β(x_i)y\_{i} = \gamma\hat{x}\_{i} + \beta = \text{BN}\_{\gamma, \beta}\left(x\_{i}\right)

Where γ\gamma and β\beta are learnable parameters.