16
$\begingroup$

I was reading the batch normalization (BN) paper (1) and didn't understand the need to use moving averages to track the accuracy of the model and even if I accepted that it was the right thing to do, I don't understand what they are doing exactly.

To my understanding (which my be wrong), the paper mentions that it uses the population statistics rather than the mini-batch, statistics once the model has finished training. After some discussion of unbiased estimates (that seems tangential to me and don't understand why it talks about that) they go and say:

Using moving averages instead, we track the accuracy of the model as it trains.

That is the part that is confusing to me. Why do they do moving averages to estimate the accuracy of the model and over what data set?

Usually what people do to estimate the generalization of their model, they just track the validation error of their model (and potentially early stop their gradient descent to regularize). However, it seems that batch normalization is doing something completely different. Can someone clarify what and why its doing something different?


1: Ioffe S. and Szegedy C. (2015),
"Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift",
Proceedings of the 32nd International Conference on Machine Learning, Lille, France, 2015.
Journal of Machine Learning Research: W&CP volume 37

$\endgroup$
6
$\begingroup$

When using batch_normalization first thing we have to understand is it work on two different ways when in Training and Testing .

  1. In Training we need to calculate mini batch mean in order to normalize the batch

  2. In the inference we just apply pre-calculated mini batch statistics

So in the 2nd thing how to calculate this mini batch statics

Here comes the moving average

running_mean = momentum * running_mean + (1 - momentum) * sample_mean
running_var = momentum * running_var + (1 - momentum) * sample_var
$\endgroup$
1
$\begingroup$

They are talking about batch normalization, which they have described for the training procedure but not for inference.

This is a process of normalizing the hidden units using sample means etc.

In this section they explain what to do for the inference stage, when you are just making predictions ( ie after training has completed).

However, in stopped validation you interleave prediction on validation set with training to estimate your validation error.

So during this process you don't have a population average (the averages are still changing as you train), so then you use a running average to calculate the batch norm parameters to calculate performance on validation set.

It is in this sense that

Using moving averages instead, we track the accuracy of the model as it trains.

nothing to do with literally using the running means as a metric for neural network performance.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.