Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

PyTorch-VAE

> DevOps
Open source

A Collection of Variational Autoencoders (VAE) in PyTorch.

7.7K stars0 likes1 views
WebsiteGitHub

About

A Collection of Variational Autoencoders (VAE) in PyTorch.

PyTorch VAE

Update 22/12/2021: Added support for PyTorch Lightning 1.5.6 version and cleaned up the code.

A collection of Variational AutoEncoders (VAEs) implemented in pytorch with focus on reproducibility. The aim of this project is to provide a quick and simple working example for many of the cool VAE models out there. All the models are trained on the CelebA dataset for consistency and comparison. The architecture of all the models are kept as similar as possible with the same layers, except for cases where the original paper necessitates a radically different architecture (Ex. VQ VAE uses Residual layers and no Batch-Norm, unlike other models). Here are the results of each model.

Requirements

  • Python >= 3.5
  • PyTorch >= 1.3
  • Pytorch Lightning >= 0.6.0 (GitHub Repo)
  • CUDA enabled computing device

Installation

$ git clone https://github.com/AntixK/PyTorch-VAE
$ cd PyTorch-VAE
$ pip install -r requirements.txt

Usage

$ cd PyTorch-VAE
$ python run.py -c configs/<config-file-name.yaml>

Config file template

…

View TensorBoard Logs

$ cd logs/<experiment name>/version_<the version you want>
$ tensorboard --logdir .

Note: The default dataset is CelebA. However, there has been many issues with downloading the dataset from google drive (owing to some file structure changes). So, the recommendation is to download the file from google drive directly and extract to the path of your choice. The default path assumed in the config files is `Data/celeba/img_align_celeba'. But you can change it acording to your preference.


Results

Model Paper Reconstruction Samples
VAE (Code, Config) Link
Conditional VAE (Code, Config) Link
WAE - MMD (RBF Kernel) (Code, Config) Link
WAE - MMD (IMQ Kernel) (Code, Config) Link
Beta-VAE (Code, Config) Link
Disentangled Beta-VAE (Code, Config) Link
Beta-TC-VAE (Code, Config) Link ![][34] ![][33]
IWAE (K = 5) (Code, Config) Link
MIWAE (K = 5, M = 3) (Code, Config) Link
DFCVAE (Code, Config) Link
MSSIM VAE (Code, Config) Link
Categorical VAE (Code, Config) Link
Joint VAE (Code, Config) Link
Info VAE (Code, Config) Link
LogCosh VAE (Code, Config) Link
SWAE (200 Projections) (Code, Config) Link
VQ-VAE (K = 512, D = 64) (Code, Config) Link N/A
DIP VAE (Code, Config) Link ![][36] ![][35]

Contributing

If you have trained a better model, using these implementations, by fine-tuning the hyper-params in the config file, I would be happy to include your result (along with your config file) in this repo, citing your name .

Additionally, if you would like to contribute some models, please submit a PR.

License

Apache License 2.0

Permissions Limitations Conditions
✔️ Commercial use ❌ Trademark use ⓘ License and copyright notice
✔️ Modification ❌ Liability ⓘ State changes
✔️ Distribution ❌ Warranty
✔️ Patent use
✔️ Private use

Citation

@misc{Subramanian2020,
  author = {Subramanian, A.K},
  title = {PyTorch-VAE},
  year = {2020},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\\url{https://github.com/AntixK/PyTorch-VAE}}
}

Issues· 68 open

View all issuesOpen on GitHub
  • #87

    About VQ-VAE

    Updated Aug 22, 2025
  • #109

    Add an upper limit to Python version [3.5, 3.7]

    Updated Jul 9, 2025
  • #104

    How to Confirm the results?

    Updated Jul 1, 2025
  • #108

    Normalization issues for dataset

    Updated Jun 12, 2025
  • #98

    pytorch_lightning.utilities.exceptions.MisconfigurationException: You requested GPUs: [1] But your machine only has: [0]

    Updated Mar 24, 2025
  • #99

    Why the model can only train on size of [64, 64]?

    Updated Jan 16, 2025
  • #71

    Training VQVAE dose not convergence.

    Updated Dec 22, 2024
  • #103

    Incorrect citation for CVAE

    Updated Dec 2, 2024
  • #102

    Swapping of regular beta-VAE and disentangling beta-VAE

    Updated Nov 14, 2024
  • #95

    TypeError: loss = recons_loss + kld_weight * kld_loss

    Updated Sep 5, 2024

> Tags

Pythonarchitecturebeta-vaeceleba-datasetdeep-learning

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理