It is the raw code to generate a quadratic girl image from a random noise array using a GAN(Generative Adversarial Networks ) network. It is based on ([GAN二次元头像生成Pytorch实现(附完整代码)(https://blog.csdn.net/qq_36937684/article/details/106215485)]
This article is Pytorch version of Li Hongyi GAN course assignments, HW3_1 (quadratic image generation, Keras implementation). The reason for writing this article is that on the one hand, I want to understand GAN, and on the other hand, I am used to using Pytorch, so I changed keras into Pytorch version.
- PyTorch
- torchvision
- visdom
- matplotlib
Resources required for implementation:
link: https://pan.baidu.com/s/1cLmFNQpJe1DOI96IVuvVyQ extract code: nha2
usage: [--train][--GPU]
[--continue_training] [--cuda]
[--datapath] [--latent_dim]
[--num_epoch] [--batch_size]
Example:
python shizuo_gan_new.py --cuda --GPU 1 --batch_size 64 --train 1 --num_epoch 300
This will start a training session in the GPU.
usage: [--test] [--GPU]
[--cuda] [--testmodelpath]
[--datapath] [--latent_dim]
The result is no different from the original keras. After all, the network is similar and does not need too high expectations. Moreover, the network itself is relatively small. Partial results are shown here.