wangyx240 / High-Resolution-Image-Inpainting-GAN

Pytorch Re-implementation of "Contextual Residual Aggregation for Ultra High-Resolution Image Inpainting"(CVPR 2020 Oral)
75 stars 12 forks source link

Can anybody explain why rescaling to [0, 1] works better than to [-1, 1] does? #8

Open AlonzoLeeeooo opened 3 years ago

AlonzoLeeeooo commented 3 years ago

I conducted a experiment between 2 groups. One is rescaling the images to [0, 1] while the other one is to [-1, 1]. The result showed that the former one works much better than the latter one. But after checking at the orginal paper, I found that the author was saying that all images was rescaled to [-1, 1] for calculation. Is this re-implementation any different than the original one? Can anybody explain why this happen? Thanks a lot! 0_to_1 -1_to_1

Shawn-Yu-1 commented 2 years ago

I think when you use the normal to rescale to [-1, 1], you should restore the result to [0,1] when you use save_image function to save the image from tensor. but when you scale to [0,1], you don't need to restore when save it.