vaegan icon indicating copy to clipboard operation
vaegan copied to clipboard

Batch Norm at test mode

Open rrahmati opened this issue 8 years ago • 4 comments

Hi, Thanks for the nice code.

It seems that the batch norm implementation does not consider if it is train mode or test mode. So, at test mode the result depends on the batch size and the examples in each batch.

rrahmati avatar Feb 14 '17 01:02 rrahmati

Thank you for pointing out it! Just as you said, it is a bug, so I will fix it.

anitan0925 avatar Feb 14 '17 03:02 anitan0925

I'm also wondering how this bug will affect the performance of the code. In testing, the mean and variance should be calculated using the whole training set. Is there any correct theano-based batch normalization code available?

WeiWangTrento avatar Mar 14 '17 17:03 WeiWangTrento

In my experience, it is not affecting the results that much given you test using a large batch size like 100. However, to achieve the best performance this needs to be fixed. This implementation of batch norm looks to be correct: https://github.com/Newmu/dcgan_code/blob/ee12b2d15a3856794b8dae77d1eb263c67c36e47/lib/ops.py

rrahmati avatar Mar 14 '17 19:03 rrahmati

Will you fix this issue soon?

DeepestNet avatar Jun 04 '18 04:06 DeepestNet