PyTorch reproduction of models and metrics for disentangled representation learning
All the libraries you need for executing codes are specified in requirements.txt. Note that cuda version should be modified based on your hardware. In addition, libraries for formatters and linters are included in the file as comments. Thus, if you want to write codes additionaly using the same formatters and linters as me, you should comment out the lines and install them as well. If you use venv, you can set up your environments as follows.
python -m venv your_env
source your_env/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
- VAE
- BetaVAE
- AnnealedVAE
- visualization of reconstruction of original inputs
- visualization of traversals in the latent space
- visualization of distributions of means and logvars
You can run pytest for all test files in lib as follows.
./script/test_lib.sh
For training
python script/interface.py train --dataset=shapes3d --train_size=10000 --eval_size=1000 --batch_size=64 --seed=0 --z_dim=10 --device=cuda --lr=1e-4 --epochs=30 --train_log=1 --save --save_dir="result/shape3d BetaVAE --beta=10.0"
For evaluation
python script/interface.py eval --save_dir="result/shape3d" --device=cpu --recons --num=5 --latent_dist