lucidrains / lightweight-gan

Implementation of 'lightweight' GAN, proposed in ICLR 2021, in Pytorch. High resolution image generations that can be trained within a day or two
MIT License
1.63k stars 222 forks source link

Regarding implementation of attn layers in discriminator #69

Closed ferrophile closed 3 years ago

ferrophile commented 3 years ago

I noticed a slight difference in implementation of generator and discriminator.

Lines 423-424, Generator.__init__

for (res, (chan_in, chan_out)) in zip(self.res_layers, in_out_features):
    image_width = 2 ** res

Lines 569-570, Discriminator.__init__

for (res, ((_, chan_in), (_, chan_out))) in zip(non_residual_resolutions, chan_in_out):
    image_width = 2 ** resolution

Is the latter a typo? resolution is tied to log2(image_size) and does not change in the for loop.

lucidrains commented 3 years ago

@ferrophile Hi Hong! You indeed caught a bug :pray: thank you so much! I've fixed it in 0.18