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.
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.