Skip to content

Latest commit

 

History

History
91 lines (69 loc) · 2.41 KB

README.md

File metadata and controls

91 lines (69 loc) · 2.41 KB

VAE Implementation with PyTorch

Description

  • This is Variational Autoencoder(VAE) Implementation with PyTorch!

Preview: CelebA

(1) Reconstruction

(2) Generation

Preview: MNIST

(1) Reconstruction

(2) Generation

(3) Latent Space t-SNE

Installation

# Docker (Optional)
docker pull ubuntu:22.04
docker run -itd --gpus=all --shm-size=16G --name=vae ubuntu:22.04 /bin/bash

apt-get update
apt-get install sudo
sudo apt-get install git
sudo apt-get install gdown # For CelebA Dataset
sudo apt-get install unzip
sudo apt-get install -y libgl1-mesa-glx # OpenCV
sudo apt-get install -y libglib2.0-0 # OpenCV

# Download
git clone https://github.com/drawcodeboy/VAE.git
cd VAE

# Download CelebA
gdown --id 1m8-EBPgi5MRubrm6iQjafK2QMHDBMSfJ --output data/
unzip data/celeba.zip -d data/
unzip data/celeba/img_align_celeba.zip -d data/celeba/

# Install Python
sudo apt-get install python3
sudo apt-get install python3-venv

# Virtual Environment
python3 venv -m .venv
source .venv/bin/activate

# Install packages
pip install -r requirements.txt

# train MNIST
python train.py --config=vae.mnist

# train CelebA
python train.py --config=vae.celeba

# test MNIST
python test.py --config=vae.mnist

# test CelebA
python test.py --config=vae.celeba

References

  1. VAE: Kingma, D. P. (2013). Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114.