Awesome
generative_zoo
generative_zoo is a repository that provides working implementations of some generative models in PyTorch.
Available Implementations
Name of Generative Model | Brief Description | References (if any) |
---|---|---|
Multilayer Perceptron GAN (MLPGAN) | Generative Adversarial Network with MLP Generator Network and Discriminator Network | Ian Goodfellow et al. |
Deep Convolutional GAN (DCGAN) | Generative Adversarial Network with Deep Convolutional Generator and Discriminator Network | Alec Radford et al. |
Variational Autoencoder (VAE) | Better performing Autoencoder with a single layer Encoder and Decoder Network | Kingma et al. |
Wasserstein GAN (WGAN) | Generative Adversarial Network with a different method of training | Martin Arjovsky et al. |
α GAN | Generative Adversarial Network combined with an Auto-Encoder and a different training strategy | Mihaela Rosca and Balaji Lakshminarayanan et al. |
Broken Implementations
- The code for VAEGAN does not generate good images. If you would like to contribute to the repo, please help solve this issue. Thanks!!
- The code for Improved WGAN provides bad images and the training is extremely unstable. If you would like to contribute to the repo, please help solve this issue. Thanks!!
Datasets
Name of Dataset | Brief Description | References (if any) |
---|---|---|
MNIST | Digit Recognition dataset | Yann LeCun et al. |
CIFAR10 | Color Image Recoginition dataset | Alex Krizhevsky |
LSUN | Large Scene Understanding | Fisher Yu et al. |
CUB200 | Birds Dataset | Wellinder et al. |
FASHION-MNIST | Clothes dataset with similar characteristics as MNIST | Zalando Research |
Requirements
- Python 3.x
- PyTorch 0.2 or better (If you want to test other models except Improved WGAN : then you can use PyTorch 0.10 or better)
- Torchvision
File Structure
Architectures
contains dataset specific architectures (currently only for MNIST and CIFAR10) and a Generic Architecture generatorModules
contains the key modules of the GANsMains
contains the sample Main files written for the GANsUtilities
contains some utility files and CUB200 and FASHION-MNIST dataset loadersExamples
contain some GIFs that show the variation in the improving quality of generated images with time
Usage of the implementations
- Clone this repository using
git clone https://github.com/DL-IT/generative_zoo.git
- From the directory you have cloned into, you will be able to use the code. Just perform
import generative_zoo
-
There are multiple submodules such as
Architectures
,Modules
andUtilities
.- In
Architectures
, you can take a data-specific architecture forMNIST
andCIFAR10
and a generic architecture which can be used for any square image in general. You need to use it using the below code:
generator = generative_zoo.Architectures.<name>.Generator(*args) discriminator = generative_zoo.Architectures.<name>.Discriminator(*args)
Here
<name>
can beCIFAR10
,MNIST
orGeneric
.- In
Modules
, you can take specific types of GANs which are listed above. This can be invoked using
my_GAN = generative_zoo.Modules.<name>(*args)
Here
<name>
can be any one of the above GAN types.- In
Utilities
, you can have some basic utilities and dataset providers. Especially,data_utilities
insideUtilities
provides data of required size and certain other specifications.
- In
-
In addition to all this, there are sample main files to give you an idea as to how the code works in all, available in
Mains
. This has to be accessed externally.
Some generations
MNIST | CIFAR10 |
---|---|
![]() | ![]() |