Code Monkey home page Code Monkey logo

dava's Introduction

DAVA: Disentangling Adversarial Variational Autoencoder

Description

This code supports the ICLR 2023 Submission DAVA: Disentangling Adversarial Variational Autoencoder

Getting Started

Dependencies

We provide two environment files, dava.yml and pipe.yml. Due to versioning conflicts with disentanglement-lib, we suggest to use separate environments for training DAVA and evaluating the PIPE metric. To our knowledge, for these two environments, no issues should arise when evaluating a model in a different environment than it was trained. We provide dsprites as an example dataset in the correct format.

DAVA

To reproduce DAVA: python dava/train_dava.py --dataset_path=datasets/dsprites.npz --z_dim=10 --batch_size=128 --num_steps=150000 --num_channels=1 --store_path=~/dava/ --disc_weight=0.3 --c_max=8 --iteration_threshold=12800000 --disc_instance_norm --gamma=500 --random_seed=0 --max_grad_norm=1 --learning_rate=0.0001 --disc_max_grad_norm=1 --disc_learning_rate=0.0001 --use_mixed_batches --model_scale_factor=1 --start_kl_step=0 --disc_confidence_value=0.6 --disc_decoder_weight=0.001

To reproduce any of the other models, for example FactorVAE: python dava/train_factor_vae.py --batch_size=128 --num_channels=1 --learning_rate=0.0001 --dataset_path=datasets/dsprites.npz --store_path=~/factor_vae/ --gamma=5 --num_steps=150000 --random_seed=0 --max_grad_norm=1

PIPE Metric

Reproducing the results of the PIPE metric is a bit more intricate. The code for computing the PIPE metric is provided in pipe_metric.py Models were trained using disentanblement-lib. We used dlib_reproduce to train Beta-TCVAEs and FactorVAEs with 6 hyperparameters and 5 random seeds each. We did this for each dataset considered. We then used disentanglement-lib to compute all supervised as well as the UDR metric. We extended disentanglement-lib so that with slight changes, it can be used to evalaute PIPE as well. We provide the necessary files here. pipe_metric.py needs to be placed in disentanglement_lib.evaluation.metrics. evaluate.py replaces disentanglement_lib.evaluation.evaluate.py. compute_metrics_vae.py gives an overview on how to start the metric computation. This works for both models reproduced with disentanglement-lib and models trained in the DAVA environment.

We further used disentanglement-lib to reproduce the results of the abstract reasoning study for BetaTCVAE and FactorVAE. Models there could be evaluated using the same procedure as explained before.

dava's People

Contributors

besterma avatar

Stargazers

 avatar  avatar Huajie Shao avatar

Watchers

Emma.jouffroy avatar  avatar

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.