Representation Learning of Image Data with VAE. Alexander Piehler, Moritz Wagner
This Github Repository is developed by Moritz Wagner and Alexander Piehler in collaboration with Adidas. This project stresses the suitability of Variational Autoencoders for representation learning of image data. The main goal was to establish a codebase that allows for reproducing and tracking experiments via mlflow. The world of Variational Autoencoders is quite large and therefore, we restricted ourselves to the ones we believed that would perform best. To further benchmark, we also included PCA and Autoencoders. The following models were considered:
├── VAE
├── beta-VAE
├── InfoVAE
├── GaussMixVAE
├── DIP-VAE
├── PCA
├── Autoencoder
For each model, we found some valid hyperparameter configurations that can be considered in the folder configs/
.
This framework is structured as follows:
├── configs
├── data
├── experiments
├── library
├── playground
configs
Contains the config files for each model depending on the chosen data set.
data
In this folder, you find all relevant python scripts to download and preprocess the data for running the models.
experiments
Contains the scripts for running all relevant experiments. To run them in the right order, follow these steps:
To run them first change into the directory accordingly: cd experiments
python seed_running.py
python latent_experiment.py
python epochs_experiment.py
python kld_weight_experiment.py
python latent_experiment.py
python tune_models.py
python run_best_configurations.py
python deep_dive.py
library
This is the package for this repository, it stores all functions and (model) classes that are used. The package contains different modules
├── models2
├── architectures.py
├── eval_helpers.py
├── evaluator.py
├── postprocessing.py
├── utils.py
├── visualizer.py
└── viz_helpers.py
playground
Contains only some playground files which are absolutely not important to consider.
library
enables pip installation and symling creationpip install -e .
from the parent tree.importlib.reload()
You can setup Representation-Learning as follows: Note, all commands must be run from parent level of the repository.
conda create -n <env name> python=3.7
)pip install -r requirements.txt
library
as described above.cd data
and executing python get_<dataset>_data.py
run.py --config/config_file.yaml
In case that hyperparameters want to be adjusted, you can do so by respectively adjusting the parameters set in the config
files.
Note, however, the parameter configurations listed we found worked best for the respective problem.
If you want to run your own experiments, it is advisable to additionally specify the run_name
and the experiment_name
.
This is required for mlflow
to log adequately.
An exemplary command could be as follows:
python run.py --configs/MNIST/vae.yaml --run_name mnist_vae --experiment_name mnist_vae