https://github.com/thomashirtz/variational-autoencoder
Implementation of a vanilla variational autoencoder using Pytorch.
https://github.com/thomashirtz/variational-autoencoder
Last synced: 5 months ago
JSON representation
Implementation of a vanilla variational autoencoder using Pytorch.
- Host: GitHub
- URL: https://github.com/thomashirtz/variational-autoencoder
- Owner: thomashirtz
- Created: 2021-05-21T19:22:48.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-15T18:31:06.000Z (about 4 years ago)
- Last Synced: 2025-05-14T17:12:17.880Z (5 months ago)
- Language: Python
- Size: 11.9 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# variational-autoencoder

## About
Implementation of the vanilla Variational AutoEncoder using Pytorch.## Usage
### Importing the module
Example of minimal script:
```
from torchvision import datasets
from torchvision import transforms
from variational_autoencoder import traindataset = datasets.MNIST(root='../data/MNIST', download=True, train=True, transform=transforms.ToTensor())
vae = get_vae(dataset=dataset)
```The `get_vae` function takes as input a torch dataset among other arguments,
Examples of utilization of this function are present in the `tests` folder.### MNIST Dashboard
A dashboard was made for the MNIST dataset using Plotly and Dash. It is located in the `__main__.py`
```
python3 variational-autoencoder
```
The script will then give the adress of the server on which dash is running
(generally http://127.0.0.1:8050/)*Help for running the dashboard:*
```
usage: Use "python variational-autoencoder --help" for more informationPyTorch Variational AutoEncoder
optional arguments:
-h, --help show this help message and exit
--file_name Name used for loading the model's weights (default: None)
--num-epochs Number of training epochs (default: 20)
--seed Seed used for pytorch (default: 4)
```## Installation
```
git clone https://github.com/thomashirtz/variational-autoencoder
cd variational-autoencoder
pip install -r requirements.txt
```## Original Paper
Auto-Encoding Variational Bayes, Kingma et al. [[arxiv]](https://arxiv.org/abs/1312.6114) (January 2013)