Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/znxlwm/pytorch-mnist-celeba-cgan-cdcgan
Pytorch implementation of conditional Generative Adversarial Networks (cGAN) and conditional Deep Convolutional Generative Adversarial Networks (cDCGAN) for MNIST dataset
https://github.com/znxlwm/pytorch-mnist-celeba-cgan-cdcgan
cdcgan celeba cgan conditional-dcgan conditional-gan gender generative-adversarial-network mnist pytorch
Last synced: 5 days ago
JSON representation
Pytorch implementation of conditional Generative Adversarial Networks (cGAN) and conditional Deep Convolutional Generative Adversarial Networks (cDCGAN) for MNIST dataset
- Host: GitHub
- URL: https://github.com/znxlwm/pytorch-mnist-celeba-cgan-cdcgan
- Owner: znxlwm
- Created: 2017-07-24T06:35:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-22T09:04:24.000Z (over 7 years ago)
- Last Synced: 2025-01-13T09:05:53.166Z (13 days ago)
- Topics: cdcgan, celeba, cgan, conditional-dcgan, conditional-gan, gender, generative-adversarial-network, mnist, pytorch
- Language: Python
- Homepage:
- Size: 45.7 MB
- Stars: 501
- Watchers: 11
- Forks: 129
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pytorch-MNIST-CelebA-cGAN-cDCGAN
Pytorch implementation of conditional Generative Adversarial Networks (cGAN) [1] and conditional Generative Adversarial Networks (cDCGAN) for MNIST [2] and CelebA [3] datasets.* The network architecture (number of layer, layer size and activation function etc.) of this code differs from the paper.
* CelebA dataset used gender lable as condition.
* If you want to train using cropped CelebA dataset, you have to change isCrop = False to isCrop = True.
* you can download
- MNIST dataset: http://yann.lecun.com/exdb/mnist/
- CelebA dataset: http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html## Implementation details
* cGAN![GAN](pytorch_cGAN.png)
* cDCGAN
![Loss](pytorch_cDCGAN.png)
## Resutls
### MNIST
* Generate using fixed noise (fixed_z_)cGAN
cDCGAN
* MNIST vs Generated images
MNIST
cGAN after 50 epochs
cDCGAN after 20 epochs
* Learning Time
* MNIST cGAN - Avg. per epoch: 9.13 sec; Total 50 epochs: 937.06 sec
* MNIST cDCGAN - Avg. per epoch: 47.16 sec; Total 20 epochs: 1024.26 sec### CelebA
* Generate using fixed noise (fixed_z_; odd line - female (y: 0) & even line - male (y: 1); each two lines have the same style (1-2) & (3-4).)cDCGAN
cDCGAN crop
* CelebA vs Generated images
CelebA
cDCGAN after 20 epochs
cDCGAN crop after 30 epochs
* CelebA cDCGAN morphing (noise interpolation)
cDCGAN
cDCGAN crop
* Learning Time
* CelebA cDCGAN - Avg. per epoch: 826.69 sec; total 20 epochs ptime: 16564.10 sec## Development Environment
* Ubuntu 14.04 LTS
* NVIDIA GTX 1080 ti
* cuda 8.0
* Python 2.7.6
* pytorch 0.1.12
* torchvision 0.1.8
* matplotlib 1.3.1
* imageio 2.2.0## Reference
[1] Mirza, Mehdi, and Simon Osindero. "Conditional generative adversarial nets." arXiv preprint arXiv:1411.1784 (2014).
(Full paper: https://arxiv.org/pdf/1411.1784.pdf)
[2] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. "Gradient-based learning applied to document recognition." Proceedings of the IEEE, 86(11):2278-2324, November 1998.
[3] Liu, Ziwei, et al. "Deep learning face attributes in the wild." Proceedings of the IEEE International Conference on Computer Vision. 2015.