This repository contains some code for demonstrating the application of Wasserstein GANs (WGANs). The code is used in the following blog posts:
- Wasserstein GANs
- Eliminating the middleman: Direct Wasserstein distance computation in WGANs without discriminator
- Conditional GANs
For further details, please refer to these posts.
Results of training a default GAN on the MNIST dataset for 50 epochs:
Results of training a Wasserstein GAN on the same dataset:
Results of training a Wasserstein GAN using the POT library, avoiding the necessity of a discriminator:
Results of training a conditional GAN:
For reproducibility:
conda create -n gan -y python=3.9
conda activate gan
conda install mamba -y
mamba install -y numpy matplotlib scikit-learn scipy pot tensorflow imageio pillow ipykernel
mamba install -y pytorch torchvision -c pytorch
pip install POT
If you want to run the code on a Mac with Apple Silicon (M1, M2), install tensorflow and pytorch as described here: