https://github.com/clementchadebec/geometric_perspective_on_vaes
Code of "A Geometric Perspective on Variational Autoencoders" (NeurIPS 2022)
https://github.com/clementchadebec/geometric_perspective_on_vaes
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (5.5%) to scientific vocabulary
Repository
Code of "A Geometric Perspective on Variational Autoencoders" (NeurIPS 2022)
Basic Info
Statistics
- Stars: 13
- Watchers: 1
- Forks: 3
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
This is the official implementation of "A Geometric Perspective on Variational Autoencoders" (NeurIPS 2022)
This code uses a version of python3.6.
Note: The method should be soon added to pythae.
To install requirement run
bash
pip install -r requirements.txt
Data folders
The data must be located in data_folders:
MNIST
The provided code requires a file mnist_32x32.npz to be located in data_folders/mnist/.
The data must be in the range [0, 255] and loadable as follows:
python
import numpy as np
mnist_digits = np.load(args.path_to_train)
train_data = mnist_digits['x_train'] # data of shape 60000x32x32x1 in [0-255]
train_targets = mnist_digits['y_train'] # corresponding labels
In data_folders/mnist/test_folder must be located 10k test images in .png format used for metric
computation
CIFAR10
The provided code requires a file cifar_10.npz to be located in data_folders/cifar/.
The data must be in the range of [0, 255] and lodable as follows:
python
import numpy as np
cifar_data = np.load(args.path_to_train)
train_data = cifar_data['x_train'] # data of shape 50000x32x32x3 in [0-255]
train_targets = cifar_data['y_train'] # corresponding labels
In data_folders/cifar/test_folder must be located 10k test images in .png format used for metric
computation
Celeba
The provided code requires a file train_data.pt to be located in data_folders/celeba/. The data
must be a big tensor of shape n_samplesx3x64x64 in the range [0, 1] and loadable as follows:
python
import torch
train_data = torch.load(os.path.join(args.path_to_train, 'train_data.pt')) # data of shape 162770x64x64x3 in the range of [0-1]
val_data = torch.load(os.path.join(args.path_to_train, 'val_data.pt')) # data of shape 19867x64x64x3 in the range of [0-1]
In data_folders/celeba/test/test must be located the test images in .png format used for metric
computation
SVHN
The provided code requires a file train_32x32.mat to be located in data_folders/svhn/.
The data must be in the rnage [0, 255] and loadable as follows:
python
from scipy.io import loadmat
svnh_digits = loadmat(args.path_to_train)['X'] # data of shape 32x32x3x73257 in the range of [0-255]
svnh_targets = loadmat(args.path_to_train)['y'] # corresponding labels
In data_folders/svhn/test_folder must be located the test images in .png format used for metric
computation.
OASIS
The provided code requires a file OASIS.npz to be located in data_folders/oasis/. The data must be in the range of [0, 255] and you must ensure that each data image has a maximum voxel value of 255 and a minimum of 0. The data must be loadable as follows
python
import numpy as np
oasis_data = np.load(args.path_to_train)
train_data = oasis_data['x_train'] # data of shape 416x208x176x1 in the range of [0-255]
train_targets = torch.tensor(oasis_data['y_train'] # corresponding targets
Performing experiments
The commandines to train a model, generate new data and compute the metrics are available in
models_to_train.sh.
Reference
bibtex
@article{chadebec2022geometric,
title={A geometric perspective on variational autoencoders},
author={Chadebec, Cl{\'e}ment and Allassonni{\`e}re, St{\'e}phanie},
journal={Advances in Neural Information Processing Systems},
volume={35},
pages={19618--19630},
year={2022}
}
Owner
- Login: clementchadebec
- Kind: user
- Company: INRIA
- Website: https://clementchadebec.github.io/
- Twitter: CChadebec
- Repositories: 7
- Profile: https://github.com/clementchadebec
GitHub Events
Total
- Watch event: 1
- Push event: 1
Last Year
- Watch event: 1
- Push event: 1
Issues and Pull Requests
Last synced: 12 months ago
Dependencies
- h5py ==2.10.0
- imageio ==2.8.0
- matplotlib ==3.3.4
- numpy *
- scikit_learn *
- scikit_learn_extra ==0.2.0
- scipy *
- torch ==1.9.0
- torchvision ==0.10.0
- tqdm ==4.61.2