wohlert/generative-query-network-pytorch

Use subpixel convolution

Closed this issue · 0 comments

Currently when increasing the spatial dimension in the generator nn.ConvTranspose2d is used leading to what is known as "checkerboard" patterns. These patterns are slightly smoothed out when put through a normal distribution in the end. A way to avoid it completely would be to use either bilinear interpolation or subpixel convolution:

self.upsample = nn.Conv2d(x_dim, x_dim*2, kernel_size=SCALE, stride=SCALE, padding=0)

F.pixel_shuffle(self.upsample(hidden_g)) + u