DmitryUlyanov / texture_nets

Code for "Texture Networks: Feed-forward Synthesis of Textures and Stylized Images" paper.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is BN running in eval mode during test time?

chanshing opened this issue · comments

Hi and thanks for the great work. I am not familiar with lua torch so I better ask: is the BN layer in "train" or "eval" mode during testing? I know that in GANs they keep the BN layer in train mode always for stability https://discuss.pytorch.org/t/why-dont-we-put-models-in-train-or-eval-modes-in-dcgan-example/7422/2
How is it implemented in your code?

Initially we were using train mode for BN at test time and observed a similar effect of an eval mode as in GAN's. We then proposed to use Instance Normalization [1] instead of BatchNorm, which works in the same way for train and test. So this repo uses Instance Norm, not BN.

[1] https://arxiv.org/abs/1701.02096