IntrinsicImage icon indicating copy to clipboard operation
IntrinsicImage copied to clipboard

Why "model:training()" in test_*.lua ?

Open Pengxiao-Wang opened this issue 5 years ago • 1 comments

https://github.com/fqnchina/IntrinsicImage/blob/48fd652e317511157c06648597da121f8d4031a5/evaluation/test_IIW.lua#L30

https://github.com/fqnchina/IntrinsicImage/blob/48fd652e317511157c06648597da121f8d4031a5/evaluation/test_MIT.lua#L25

https://github.com/fqnchina/IntrinsicImage/blob/48fd652e317511157c06648597da121f8d4031a5/evaluation/test_MPI.lua#L25

Pengxiao-Wang avatar Jan 26 '20 04:01 Pengxiao-Wang

https://github.com/fqnchina/IntrinsicImage/blob/48fd652e317511157c06648597da121f8d4031a5/evaluation/test_IIW.lua#L30

https://github.com/fqnchina/IntrinsicImage/blob/48fd652e317511157c06648597da121f8d4031a5/evaluation/test_MIT.lua#L25

https://github.com/fqnchina/IntrinsicImage/blob/48fd652e317511157c06648597da121f8d4031a5/evaluation/test_MPI.lua#L25

Maybe it's because there are batch normalization layers within the network structure, which will use global mean and variance if the mode is set to 'eval()' during test phase. By set the mode to "training()", for each input's feature maps, the BN layers just use current features' mean and variance for each channel. As intrinsic decomposition is a pixel-wise prediction task, which is different from those high level tasks such as classification, using global mean and variance in BN layers may degrade current results.

rongduo avatar Jul 21 '20 08:07 rongduo