All Projects → Natsu6767 → Dcgan Pytorch

Natsu6767 / Dcgan Pytorch

PyTorch Implementation of DCGAN trained on the CelebA dataset.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Dcgan Pytorch

Semantic image inpainting
Semantic Image Inpainting
Stars: ✭ 140 (+337.5%)
Mutual labels:  gan, generative-model, dcgan
Psgan
Periodic Spatial Generative Adversarial Networks
Stars: ✭ 108 (+237.5%)
Mutual labels:  gan, generative-model, dcgan
Spectralnormalizationkeras
Spectral Normalization for Keras Dense and Convolution Layers
Stars: ✭ 100 (+212.5%)
Mutual labels:  gan, deeplearning, generative-model
Dcgan Tensorflow
A tensorflow implementation of "Deep Convolutional Generative Adversarial Networks"
Stars: ✭ 6,963 (+21659.38%)
Mutual labels:  gan, generative-model, dcgan
Mimicry
[CVPR 2020 Workshop] A PyTorch GAN library that reproduces research results for popular GANs.
Stars: ✭ 458 (+1331.25%)
Mutual labels:  gan, dcgan
Deep Learning Resources
由淺入深的深度學習資源 Collection of deep learning materials for everyone
Stars: ✭ 422 (+1218.75%)
Mutual labels:  gan, deeplearning
Seqgan
A simplified PyTorch implementation of "SeqGAN: Sequence Generative Adversarial Nets with Policy Gradient." (Yu, Lantao, et al.)
Stars: ✭ 502 (+1468.75%)
Mutual labels:  gan, generative-model
Segan
Speech Enhancement Generative Adversarial Network in TensorFlow
Stars: ✭ 661 (+1965.63%)
Mutual labels:  gan, generative-model
Pycadl
Python package with source code from the course "Creative Applications of Deep Learning w/ TensorFlow"
Stars: ✭ 356 (+1012.5%)
Mutual labels:  gan, dcgan
Deeplearning
深度学习入门教程, 优秀文章, Deep Learning Tutorial
Stars: ✭ 6,783 (+21096.88%)
Mutual labels:  gan, deeplearning
Deeplearningmugenknock
でぃーぷらーにんぐを無限にやってディープラーニングでDeepLearningするための実装CheatSheet
Stars: ✭ 684 (+2037.5%)
Mutual labels:  deeplearning, dcgan
Igan
Interactive Image Generation via Generative Adversarial Networks
Stars: ✭ 3,845 (+11915.63%)
Mutual labels:  gan, dcgan
Tensorflow Generative Model Collections
Collection of generative models in Tensorflow
Stars: ✭ 3,785 (+11728.13%)
Mutual labels:  gan, generative-model
Tf.gans Comparison
Implementations of (theoretical) generative adversarial networks and comparison without cherry-picking
Stars: ✭ 477 (+1390.63%)
Mutual labels:  gan, dcgan
Pytorch Mnist Celeba Gan Dcgan
Pytorch implementation of Generative Adversarial Networks (GAN) and Deep Convolutional Generative Adversarial Networks (DCGAN) for MNIST and CelebA datasets
Stars: ✭ 363 (+1034.38%)
Mutual labels:  gan, dcgan
Awesome Gans
Awesome Generative Adversarial Networks with tensorflow
Stars: ✭ 585 (+1728.13%)
Mutual labels:  gan, dcgan
Generative Models
Collection of generative models, e.g. GAN, VAE in Pytorch and Tensorflow.
Stars: ✭ 6,701 (+20840.63%)
Mutual labels:  gan, generative-model
Gans In Action
Companion repository to GANs in Action: Deep learning with Generative Adversarial Networks
Stars: ✭ 748 (+2237.5%)
Mutual labels:  gan, dcgan
Keras Dcgan
Keras implementation of Deep Convolutional Generative Adversarial Networks
Stars: ✭ 943 (+2846.88%)
Mutual labels:  gan, dcgan
T81 558 deep learning
Washington University (in St. Louis) Course T81-558: Applications of Deep Neural Networks
Stars: ✭ 4,152 (+12875%)
Mutual labels:  gan, deeplearning

Deep Convolutional GAN

PyTorch implementation of DCGAN introduced in the paper: Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks, Alec Radford, Luke Metz, Soumith Chintala.

Generated Data Animation

Introduction

Generative Adversarial Networks (GANs) are one of the most popular (and coolest) Machine Learning algorithms developed in recent times. They belong to a set of algorithms called generative models, which are widely used for unupervised learning tasks which aim to learn the uderlying structure of the given data. As the name suggests GANs allow you to generate new unseen data that mimic the actual given real data. However, GANs pose problems in training and require carefullly tuned hyperparameters.This paper aims to solve this problem.

DCGAN is one of the most popular and succesful network design for GAN. It mainly composes of convolution layers without max pooling or fully connected layers. It uses strided convolutions and transposed convolutions for the downsampling and the upsampling respectively.

Generator architecture of DCGAN

DCGAN Generator

Network Design of DCGAN:

  • Replace all pooling layers with strided convolutions.
  • Remove all fully connected layers.
  • Use transposed convolutions for upsampling.
  • Use Batch Normalization after every layer except after the output layer of the generator and the input layer of the discriminator.
  • Use ReLU non-linearity for each layer in the generator except for output layer use tanh.
  • Use Leaky-ReLU non-linearity for each layer of the disciminator excpet for output layer use sigmoid.

Hyperparameters for this Implementation

Hyperparameters are chosen as given in the paper.

  • mini-batch size: 128
  • learning rate: 0.0002
  • momentum term beta1: 0.5
  • slope of leak of LeakyReLU: 0.2
  • For the optimizer Adam (with beta2 = 0.999) has been used instead of SGD as described in the paper.

Data

This implementation uses the CelebA dataset. However, any other dataset can also be used. Download the data and update the directory location inside the root variable in utils.py.

CelebA Dataset

Training Data

Training

To train the model, run train.py. To set the training parametrs, update the values in the params dictionary in train.py. Checkpoints would be saved by default in model directory every 2 epochs. By default, GPU is used for training if available.

Training will take a long time. It took me around 3 hours on a NVIDIA GeForce GTX 1060 GPU. Using a CPU is not recommended.

Loss Curves

Training Loss Curves

D: Discriminator, G: Generator

Generating New Images

To generate new unseen images, run generate.py.

python3 generate.py --load_path /path/to/pth/checkpoint --num_output n

Generated Images

After Epoch 1: Generated Images after 1st Epoch After Epoch 10: Generated Images after 10th Epoch

References

  1. Alec Radford, Luke Metz, Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks.[arxiv]
  2. Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, Yoshua Bengio. Generative adversarial nets. NIPS 2014 [arxiv]
  3. Ian Goodfellow. Tutorial: Generative Adversarial Networks. NIPS 2016 [arxiv]
  4. DCGAN Tutorial. [https://pytorch.org/tutorials/beginner/dcgan_faces_tutorial.html]
  5. PyTorch Docs. [https://pytorch.org/docs/stable/index.html]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].