junyanz / pytorch-CycleGAN-and-pix2pix

Image-to-Image Translation in PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why no ReflectionPad2d in the two downsampling layers of ResNetGenerator?

j314erre opened this issue · comments

Why do the 2nd and 3rd Conv2d layers use normal zero padding while all the other Conv2d layers including the ResnetBlocks use ReflectionPad2d?

n_downsampling = 2
        for i in range(n_downsampling):  # add downsampling layers
            mult = 2 ** i
            model += [nn.Conv2d(ngf * mult, ngf * mult * 2, kernel_size=3, stride=2, padding=1, bias=use_bias),
                      norm_layer(ngf * mult * 2),
                      nn.ReLU(True)]

We adopted the network architectures from the fast neural style transfer paper. They did not use reflection padding for the downsampling layers. See this line.

Thanks for the info!