Code for my Master thesis on "Capsule Architecture as a Discriminator in Generative Adversarial Networks".
Clone or download
Latest commit a840741 Feb 2, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
out_metrics Train on CIFAR10, fix comments Jan 24, 2018
.gitignore Added __pycache__/ Jan 27, 2018
LICENSE Initial commit Jan 5, 2018
README.md Fix image output links Feb 1, 2018
capsule_gan.ipynb Remove log messages Jan 26, 2018
environment.yml Remove log messages Jan 26, 2018
inception_score.ipynb Calculate Inception score Jan 30, 2018

README.md

Capsule GAN

Code for my Master thesis on "Capsule Layer as a Discriminator in Generative Adversarial Networks". In order to reproduce results, follow the "capsule_gan" Jupyter notebook that contains:

  • Dataset loading and preprocessing
  • Both Discriminator and Generator structures
  • Training, loss functions
  • Image outputs
  • Metrics visualization

But first you may want to install Miniconda and corresponding dependencies from environment.yml: conda env create -f environment.yml within the project directory as well as install required tools for GPU computing. If no GPU is going to be used - delete the tensorflow-gpu line from environment.yml.

Generated images

MNIST_output CIFAR10_output

All generated MNIST images over 30k epochs All generated CIFAR10 images over 30k epochs

Generator weights for MNIST Generator weights for CIFAR10

Thanks to @eriklindernoren (https://github.com/eriklindernoren/Keras-GAN) who I borrowed the Keras implementation of DCGAN from and @XifengGuo (https://github.com/XifengGuo/CapsNet-Keras) who I took the squashing function from.