Shift-Net icon indicating copy to clipboard operation
Shift-Net copied to clipboard

About maskModel weight

Open JinMengKang opened this issue 6 years ago • 1 comments

Why is the maskModel weight = 1/16? Like this -> netG.modules[41].weight:fill(1/16) (train.lua Line 152) Thank you for your patient answer.

JinMengKang avatar Jul 21 '18 09:07 JinMengKang

Hi, in fact it is a trick to define the masked region in feature space. Always, the simplest way is directly resizing the mask. However, in fact the border of masked and unmasked region is blur as convolution makes information spread from outside into inside. As we use convolutions with 4*4 kernels. We process the mask with the similar operation(with 4*4 convs) as how we process the input image. So we need to fill them with '1/16'. In this case, if the window of the conv falls totally in the masked region, it gets '1' everywhere. If the window falls partly in the masked region, it gets a decimal number. A threshold is set to figure out the border.

Zhaoyi-Yan avatar Jul 22 '18 03:07 Zhaoyi-Yan