Skip to content

reproduction of models for disentangled representation learning

License

Notifications You must be signed in to change notification settings

masahiro-negishi/disentanglement_zoo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

disentanglement_zoo

licence: MIT Codestyle: black Checked with mypy Imports: isort

PyTorch reproduction of models and metrics for disentangled representation learning

Environment setup

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

Available models

  • VAE
  • BetaVAE
  • AnnealedVAE

Available metrics

  • visualization of reconstruction of original inputs
  • visualization of traversals in the latent space
  • visualization of distributions of means and logvars

Test lib

You can run pytest for all test files in lib as follows.

./script/test_lib.sh

Example

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

About

reproduction of models for disentangled representation learning

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published