christiancosgrove / pytorch-spectral-normalization-gan

Paper by Miyato et al. https://openreview.net/forum?id=B1QRgziT-
MIT License
676 stars 110 forks source link

How can I generate bigger than 64x64 with this source? #11

Closed bemoregt closed 5 years ago

bemoregt commented 5 years ago

Hi, @christiancosgrove

How can I generate bigger than 64x64 with this source?

I want to get a size of 128x128 or above sizeed image.

If Spectral Norm is good for safe training of GAN, I think that bigger sized generation is also possible..., Right?

Thanks in advance~ from @bemoregt.

christiancosgrove commented 5 years ago

Hi @bemoregt ,

If you want to generate larger images, you might have to add additional layers to the discriminator and generator. That is, in the discriminator, you have alternating stride 1 and stride 2 convolutional layers. To receive an image input of 64 (2x bigger), you'd want to add one more layer with stride 2. To generate images of size 128, you would want to add two layers with stride 2.

Same thing applies to the generator. Add 1 more layer of stride 2 (with batch norm and nonlinearity) to get a size of 64, etc.

The Miyato paper indeed uses spectral normalization to generate images larger than 32x32, so yes, this code should work to generate larger images.

Hope this helps. Christian