Giter Site home page Giter Site logo

christopher-beckham / amr Goto Github PK

View Code? Open in Web Editor NEW
33.0 4.0 2.0 14.23 MB

Official adversarial mixup resynthesis repository

License: BSD 3-Clause "New" or "Revised" License

Python 74.86% Shell 25.14%
unsupervised-learning autoencoders celeba-dataset mnist-dataset kmnist svhn-dataset mixup adversarial-mixup-resynthesis representation-learning acai

amr's Introduction

Adversarial mixup resynthesis

Christopher Beckham, Sina Honari, Vikas Verma, Alex Lamb, Farnoosh Ghadiri, R Devon Hjelm, Yoshua Bengio, Christopher Pal

[paper] [video] [poster]

In this paper, we explore new approaches to combining information encoded within the learned representations of autoencoders. We explore models that are capable of combining the attributes of multiple inputs such that a resynthesised output is trained to fool an adversarial discriminator for real versus synthesised data. Furthermore, we explore the use of such an architecture in the context of semi-supervised learning, where we learn a mixing function whose objective is to produce interpolations of hidden states, or masked combinations of latent representations that are consistent with a conditioned class label. We show quantitative and qualitative evidence that such a formulation is an interesting avenue of research.

Setting up the project

Cloning the repository:

$ git clone https://github.com/christopher-beckham/amr.git

Environment setup

  1. Install Anaconda, if not already done, by following these instructions: https://docs.anaconda.com/anaconda/install/linux/

  2. Create a conda environment using the environment.yaml file, to install the dependencies:
    $ conda env create -f environment.yaml

  3. Activate the new conda environment: $ conda activate amr

(Note: this was my dev environment exported directly to yaml, and may contain a lot of unnecessary dependencies. If you want a more clean environment, it shouldn't be too hard to start from scratch -- all of the dependencies can be easily downloaded with either pip or conda.)

Getting the data

For most of the experiments, there is no need to download external datasets since they are already provided torchvision (namely, MNIST and SVHN). The exception to this is the DSprites dataset (used for the disentanglement experiments). In order to download this, simply do:

cd iterators
wget https://github.com/deepmind/dsprites-dataset/raw/master/dsprites_ndarray_co1sh3sc6or40x32y32_64x64.npz

Running experiments

The experiment scripts can be found in the exps folder. Simply cd into this folder and run bash <folder_name>/<script_name>.sh. Experiments for Table 1 in the paper correspond to the folders mnist_downstream, kmnist_downstream, and svhn32_downstream. For Table 3, consult svhn256_downstream.

Training the models

In order to launch experiments, we use the task_launcher.py script. This is a bit hefty at this point and contains a lot of argument options, so it's recommended you get familiar with them by running python task_launcher.py --help. You can also see various examples of its usage by looking at the experimental scripts in the exps folder.

Evaluating samples

This also easy! Simply add --mode=interp_train (or --mode=interp_valid) to the script. This changes the mode in the task launcher script from training (which is the default) to interpolation mode. In this mode, interpolations between samples will be produced and output in the results folder. The number of samples used for interpolation is dependent on --val_batch_size.

Notes

Troubleshooting

If you are experiencing any issues, please file a ticket in the Issues section.

amr's People

Contributors

christopher-beckham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

hrnoh jingcx

amr's Issues

Disentangle metric issue

The disentanglement metric seems to have not been implemented correctly, which affects the DSprite experiments in the paper. I will provide an update when I have time to look further. Thanks.

cannot create environment

I got error when running this command "conda env create -f environment.yaml". I have not found this files on arm folder and on github. Did you put it somewhere or how to create environment with dependencies?

Error:
EnvironmentFileNotFound: '../GitHub/amr/environment.yaml' file not found.

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.