Work by Regis Djaha and Iñigo Urtega on understanding AEs and VAEs.
This work lead to this Master's Thesis project.
Directory for documentation (reports, papers of interest, etc).
Directory where our code will be place in.
-
Clone this repository.
git clone https://github.com/RegisKonan/ae_vae_understanding.git cd ae_vae_understanding
-
Install package virtualenv
pip install virtualenv
-
Create a environment python
virtualenv [name], example : virtualenv env
-
Activate virtualenv
macOS version : source [name]/bin/activate, example: source env/bin/activate
windows version : \[name]\Scripts\activate, example: \env\Scripts\activate
- Install
requirements.txt
.
pip install -r requirements.txt
-
conda create -n [name], example: conda create -n env or conda create -n env python=3.12.2
- Activate
conda activate [name], example: conda activate env
- Install
requirements.txt
.
pip install -r requirements.txt
- Make sure you are in the main
ae_vae_understanding
directory
cd /path-to-ae_vae_understanding
You can choose the type of dataset and model you want to use, as well as the number
dataset_name= [MNIST, FashionMNIST, FreyFace]
model_name = [AE, VAE]
To run the experiment scripts, call them from your ae_vae_understanding
directory:
- Test1: script/AE_VAE_experiment_nL.py.
python script/AE_VAE_experiment_nL.py -dataset_name FreyFace -model_name AE -n_L 3 7 -D_z 5
In this script, we have fixed the dimension
- Test2: script/AE_VAE_experiment_Dz.py.
python script/AE_VAE_experiment_Dz.py -dataset_name FashionMNIST -model_name VAE -n_L 3 -D_z 2 5
In this script, we have fixed the number of layers and varied the dimensions.
We used the same code as in script/AE_VAE_experiment_nL.py and script/AE_VAE_experiment_Dz.py, replacing standard_gaussian with mean_conditional_gaussian and defining gaussian_distribution as gaussian_distribution.
In this experiment, we defined means and standard deviations.
python script/AE_VAE_experiment.py -dataset_name MNIST -model_name VAE -beta 0.02 1 1.5 10 -n_L 1 -D_z 5
In this script, we have fixed the value of beta and varied the number of layers and the dimension
- Test1: script/Run_code_AE_VAE.py
python script/Run_code_AE_VAE.py -dataset_name FreyFace -model_name AE -n_L 1 -D_z 2
- Test2: script/Run_code_beta_VAE.py
python script/Run_code_beta_VAE.py -dataset_name FreyFace -model_name VAE -beta 0.02 1 1.5 10 -n_L 1 -D_z 5
Notebooks are included to show the following steps.
- Start jupyter.
jupyter notebook
-
Navigate to the notebooks folder.
-
First run all cells.
If you find any bugs or have any questions about this code, please contact Regis rdjaha@bcamath.org.
We thank La Caixa Junior Leader program’s LCF/BQ/PI22/11910028 award for financial support of this work.