Skip to content

Implementation of InfoGAN using PyTorch lightning

License

Notifications You must be signed in to change notification settings

astorfi/infogan-pytorch-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infogan

This project is an implementation of the paper infoGAN using Pytorch Lightning.

Setup

git clone https://github.com/mohith-sakthivel/infogan-pytorch.git infogan_pl
cd infogan_pl

conda env create -f environment.yml
conda activate infogan_pl

Run

To train the model on MNIST dataset , use

python -m infogan.infogan_module --datadir <dir> --max_epochs <max_epochs>

Arguments:

datadir     - Directory to log data
max_epochs  - Maximum number of training epochs

Learnt Latent factors

InfoGAN can learn meaningul disentangled features in an unsupervised fashion. The following figures illustrate the high level image features captured by the latent factors when trained on the MNIST dataset. The latent code used has a variable sampled from a uniform categorical distribution with 10 classes and 2 independent gaussian variables.

Categorical Latents

  • The follwing figure show the variation in the generated images with each class of the categorical distribution.
  • The categorical latents captures the 10 digit classes

Gaussian Latents

  • The follwing figures show the variation in the generated images when the a single gaussian variable is gradually changed from -5 to +5.
  • The first gaussian latent code learns to capture the thickness of the text

  • The second gaussian latent code captures the orientation (or) slant of the digit

To Do

- Add other datasets
- Implement Wasserstein loss with spectral normalization

References

  1. X Chen, Y Duan, R Houthooft, J Schulman, I Sutskever, P Abbeel - InfoGAN: Interpretable Representation Learning by Information Maximizing Generative Adversarial Nets, NeurIPS 2016. (paper)

About

Implementation of InfoGAN using PyTorch lightning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%