This repository contains code and ideas about Variational Autoencoders. The current code contains an implementation of Variational Bayesian Autoencoders and its deviations, such as β-VAE or σ-VAE. As a Dataset I have used the MNIST and CelebA Dataset.
Please refer to the following docs for more in-depth information and mathematical foundations of VAEs:
- Summary report of VAEs: https://github.com/robinmittas/variational-autoencoder/blob/main/Variational_Autoencoder%20Robin%20Mittas.pdf
- Slides to my presentation about VAEs: https://github.com/robinmittas/variational-autoencoder/blob/main/presentation.pdf
- Short handout with the most important information of my talk: https://github.com/robinmittas/variational-autoencoder/blob/main/Handout.pdf
The code needs to be cleaned, as well as the further implementation of some LadderVAE/ Inverse autoregressive Flows is on my Todo List.
Sample:
Reconstructions:
Sample:
Reconstructions:
Sample:
Reconstructions:
Following GIF comes from a β-VAE with Latent dimension 12. Each image represents one decoded Vector
The following image illustrates the Latent Space distribution for a σ-VAE with 2-dimensional Latent Space. The image on the top right is a decoded Image of the sample (-1,1), the top right displays the decoded Image of the latent vector (1,1).
- Create venv
First of all we create a virtual Environment, activate it and install the requirements. If you use Pycharm you cann also add an interpreter, select "virtual environment" and create it. Afterwards you just need to execute the last two commands.
cd variational-autoencoder
python -m venv venv/
venv/Scripts/activate.bat # For windows users: venv\Scripts\activate.bat (in anaconda prompt)
python -m pip install -r requirements.txt
Depending on your IDE you can select the just created venv as Python Interpreter.
- Tensorboard
cd variational-autoencoder
tensorboard --logdir=logs_tensorboard
#### or if we use Ligtning Module
tensorboard --logdir=logs/Model/version_xy
The code and ideas come from different sources which are listed here and on the PDF slides:
https://github.com/AntixK/PyTorch-VAE
https://github.com/orybkin/sigma-vae-pytorch
https://arxiv.org/pdf/1312.6114.pdf