Skip to content

ThomasMrY/RF-VAE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RF VAE

Pytorch implementation of RF_VAE proposed in Relevance Factor VAE: Learning and Identifying Disentangled Factors, Kim et al.(https://arxiv.org/abs/1902.01568)

Dependencies

python 3.6.4
pytorch 0.4.0 (or check pytorch-0.3.1 branch for pytorch 0.3.1)
visdom
tqdm

Datasets

  1. 2D Shapes(dsprites) Dataset
sh scripts/prepare_data.sh dsprites
  1. 3D Chairs Dataset
sh scripts/prepare_data.sh 3DChairs
  1. CelebA Dataset(download)
# first download img_align_celeba.zip and put in data directory like below
└── data
    └── img_align_celeba.zip

# then run scrip file
sh scripts/prepare_data.sh CelebA

then data directory structure will be like below

.
└── data
    └── dsprites-dataset
        └── dsprites_ndarray_co1sh3sc6or40x32y32_64x64.npz
    ├── 3DChairs
        └── images
            ├── 1_xxx.png
            ├── 2_xxx.png
            ├── ...
    ├── CelebA
        └── img_align_celeba
            ├── 000001.jpg
            ├── 000002.jpg
            ├── ...
            └── 202599.jpg
    └── ...

NOTE: I recommend to preprocess image files(e.g. resizing) BEFORE training and avoid preprocessing on-the-fly.

Usage

initialize visdom

python -m visdom.server

you can reproduce results below as follows

e.g.
sh scripts/run_celeba.sh $RUN_NAME
sh scripts/run_dsprites_gamma6p4.sh $RUN_NAME
sh scripts/run_dsprites_gamma10.sh $RUN_NAME
sh scripts/run_3dchairs.sh $RUN_NAME

or you can run your own experiments by setting parameters manually

e.g.
python main.py --name run_celeba --dataset celeba --gamma 6.4 --lr_VAE 1e-4 --lr_D 5e-5 --z_dim 10 ...

check training process on the visdom server

localhost:8097

visdom line plot

##### latent traversal gif(```--save_output True```)

reconstruction(left: true, right: reconstruction)

Reference

  1. Relevance Factor VAE: Learning and Identifying Disentangled Factors.(https://arxiv.org/abs/1902.01568)

About

Pytorch implementation of RF_VAE proposed in Relevance Factor VAE: Learning and Identifying Disentangled Factors, Kim et al.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published