This is an article about using variational autoencoders for the generation of new data. It contains the code for training the mentioned models on celeb_a and generating the plots. It was written for a seminar I attended.
tensorflow, tensorflow-probabilty, matplotlib and PIL are required.
- download the celeb_a dataset to
[PATH TO REPO]/datasets
- run this to crop the dataset to 64x64 and save it under
datasets/cropped
sh prepare_data.sh datasets/img_align_celeba/img_align_celeba datasets/cropped/img
- run this to train the models on the cropped dataset, the weights will be saved under
/models
sh train_models.sh datasets/cropped
- run this to generate a plot of all latent dimensions being traversed with a random image and save it under
plots/
sh explore_model.sh datasets/cropped/img ./plots models/my_model
- modify
example_config.json
to fit your trained models, you can determine the feature dimensions by looking at the plot generated in the previous step - run this to generate the plots and save them under
plots/
sh generate_plots.sh datasets/cropped/img ./plots ./my_config.json
- An Introduction to Variational Autoencoders
- beta-VAE: Learning Basic Visual Concepts with a Constrained Variational Framework
- Isolating Sources of Disentanglement in VAEs
for more information see the references in the report