Giter Site home page Giter Site logo

near32 / factorvae Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 1konny/factorvae

0.0 2.0 0.0 8.02 MB

Pytorch implementation of FactorVAE proposed in Disentangling by Factorising(http://arxiv.org/abs/1802.05983)

License: MIT License

Python 91.77% Shell 8.23%

factorvae's Introduction

FactorVAE

Pytorch implementation of FactorVAE proposed in Disentangling by Factorising, Kim et al.(http://arxiv.org/abs/1802.05983)

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

Results - 2D Shapes(dsprites) Dataset

Reconstruction($\gamma$=6.4)

Latent Space Traverse($\gamma$=6.4)


Latent Space Traverse($\gamma$=10)

Results - CelebA Dataset

Reconstruction

Latent Space Traverse


Results - 3D Chairs Dataset

Reconstruction

Latent Space Traverse


Reference

  1. Disentangling by Factorising, Kim et al.(http://arxiv.org/abs/1802.05983)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.