generative_zoo

December 19, 2018 · View on GitHub

generative_zoo is a repository that provides working implementations of some generative models in PyTorch.

Available Implementations

Name of Generative ModelBrief DescriptionReferences (if any)
Multilayer Perceptron GAN (MLPGAN)Generative Adversarial Network with MLP Generator Network and Discriminator NetworkIan Goodfellow et al.
Deep Convolutional GAN (DCGAN)Generative Adversarial Network with Deep Convolutional Generator and Discriminator NetworkAlec Radford et al.
Variational Autoencoder (VAE)Better performing Autoencoder with a single layer Encoder and Decoder NetworkKingma et al.
Wasserstein GAN (WGAN)Generative Adversarial Network with a different method of trainingMartin Arjovsky et al.
α GANGenerative Adversarial Network combined with an Auto-Encoder and a different training strategyMihaela 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 DatasetBrief DescriptionReferences (if any)
MNISTDigit Recognition datasetYann LeCun et al.
CIFAR10Color Image Recoginition datasetAlex Krizhevsky
LSUNLarge Scene UnderstandingFisher Yu et al.
CUB200Birds DatasetWellinder et al.
FASHION-MNISTClothes dataset with similar characteristics as MNISTZalando 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 generator
  • Modules contains the key modules of the GANs
  • Mains contains the sample Main files written for the GANs
  • Utilities contains some utility files and CUB200 and FASHION-MNIST dataset loaders
  • Examples 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 and Utilities.

    • In Architectures, you can take a data-specific architecture for MNIST and CIFAR10 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 be CIFAR10, MNIST or Generic.

    • 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 inside Utilities provides data of required size and certain other specifications.
  • 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

MNISTCIFAR10
MNIST GenerationCIFAR10 Generation