What's the recommended padding for implementing Generative Adversarial Network (GAN)?

I am working on implementing GAN to generate high-resolution CelebA image.

There are two questions as below.

  1. Can i use nn.Conv2d and nn.Conv2dTranspose2d with non-zero padding (e.g. reflection padding)? Is the following method the most desirable?

    padded_images = nn.functional.pad(images, pad=(...), mode='reflect')
    outputs = nn.Conv2d(padded_images, ..., padding=0)
  2. What’s the recommended padding for nn.Conv2d and nn.Conv2dTranspose to reduce the artifacts in GAN? (zero, reflect or replicate)


  1. yes, F.pad is the most desirable way.
  2. You can use Conv + PixelShuffle, instead of using ConvTranspose. See http://distill.pub/2016/deconv-checkerboard for details.

As per reducing artifacts, resize-conv might be a good solution as said in the blog, however, I just wonder what about using standard deconv layers which have kernel sizes divided by the stride sizes? Is this a good solution too?

Thanks for such useful link from newbie!