Instance norm 2d running mean and running var


trying to use this instancenorm 2d from pytorch

I now know that it only outputs statistics only if it was mentioned by user ( track_running_stats = True)
why is this different from batchnorm where it always holds on to statistics while training?

one more question

I learned that instancenorm 2d is a normalization to each picture within a batch. However, when I ask for running mean and running var, it will only give me a tensor of shape (mini_batch_size,)

This is the same size to that of batchnorm. However, since instancenorm 2d is doing normalization to each images whereas batchnorm is doing it to whole minibatch, instancenorm 2d should have more statistics than that of batchnorm. Why is it not the case here? Thank you

hi ~
I find similar questions with you, which the running_mean/var’s shape is C but not NC .
From the page pytorch/Normalization.cpp at master · pytorch/pytorch · GitHub, the code shows “at::alias(running_mean).copy_(running_mean_.view({ b, c }).mean(0, false));”. I don’t understand the operation of “mean(0,flase)” is use for ? (B