Newmu / dcgan_code

Deep Convolutional Generative Adversarial Networks
MIT License
3.42k stars 696 forks source link

How to generate a single sample? #15

Open falcon000 opened 8 years ago

falcon000 commented 8 years ago

Could someone tell me how to generate a single sample? For a single input, batchnorm changes it to [0, 0, 0...], so generated images are always the same no matter what the input is.

udibr commented 8 years ago

the only way I found was to generate a random batch of images and pick just one. You can look at my code at https://github.com/udibr/dcgan_code/blob/master/acro/train_uncond_dcgan.py it includes many generation features including filtering images that look "better" and generating GIF

HTH, Udi

udibr commented 8 years ago

this notebook has instructions on how to generate single images (with or without selection of better looking images) https://github.com/udibr/dcgan_code/blob/master/acro/one%20cool%20trick%20for%20GAN.ipynb

soumith commented 8 years ago

@udibr that's a cool trick.

falcon000 commented 8 years ago

@udibr Thanks man. Very helpful code and notebook. The blog post about #selfie is cool too.