Adversarially Learned Inference

Related tags

Deep LearningALI
Overview

Adversarially Learned Inference

Code for the Adversarially Learned Inference paper.

Compiling the paper locally

From the repo's root directory,

$ cd papers
$ latexmk --pdf adverarially_learned_inference

Requirements

  • Blocks, development version
  • Fuel, development version

Setup

Clone the repository, then install with

$ pip install -e ALI

Downloading and converting the datasets

Set up your ~/.fuelrc file:

$ echo "data_path: \"<MY_DATA_PATH>\"" > ~/.fuelrc

Go to <MY_DATA_PATH>:

$ cd <MY_DATA_PATH>

Download the CIFAR-10 dataset:

$ fuel-download cifar10
$ fuel-convert cifar10
$ fuel-download cifar10 --clear

Download the SVHN format 2 dataset:

$ fuel-download svhn 2
$ fuel-convert svhn 2
$ fuel-download svhn 2 --clear

Download the CelebA dataset:

$ fuel-download celeba 64
$ fuel-convert celeba 64
$ fuel-download celeba 64 --clear

Training the models

Make sure you're in the repo's root directory.

CIFAR-10

$ THEANORC=theanorc python experiments/ali_cifar10.py

SVHN

$ THEANORC=theanorc python experiments/ali_svhn.py

CelebA

$ THEANORC=theanorc python experiments/ali_celeba.py

Toy task

$ THEANORC=theanorc python experiments/ali_mixture.py
$ THEANORC=theanorc python experiments/gan_mixture.py

Evaluating the models

Samples

$ THEANORC=theanorc scripts/sample [main_loop.tar]

e.g.

$ THEANORC=theanorc scripts/sample ali_cifar10.tar

Interpolations

$ THEANORC=theanorc scripts/interpolate [which_dataset] [main_loop.tar]

e.g.

$ THEANORC=theanorc scripts/interpolate celeba ali_celeba.tar

Reconstructions

$ THEANORC=theanorc scripts/reconstruct [which_dataset] [main_loop.tar]

e.g.

$ THEANORC=theanorc scripts/reconstruct cifar10 ali_cifar10.tar

Semi-supervised learning on SVHN

First, preprocess the SVHN dataset with the learned ALI features:

$ THEANORC=theanorc scripts/preprocess_representations [main_loop.tar] [save_path.hdf5]

e.g.

$ THEANORC=theanorc scripts/preprocess_representations ali_svhn.tar ali_svhn_preprocessed.hdf5

Then, launch the semi-supervised script:

$ python experiments/semi_supervised_svhn.py ali_svhn.tar [save_path.hdf5]

e.g.

$ python experiments/semi_supervised_svhn.py ali_svhn_preprocessed.hdf5

[...]
Validation error rate = ... +- ...
Test error rate = ... +- ...

Toy task

$ THEANORC=theanorc scripts/generate_mixture_plots [ali_main_loop.tar] [gan_main_loop.tar]

e.g.

$ THEANORC=theanorc scripts/generate_mixture_plots ali_mixture.tar gan_mixture.tar
Comments
  • Conditional Generation

    Conditional Generation

    I'm interested in getting the update to this codebase that includes the conditional generation, as covered in the more recent version of the paper (related image below). Can you let me know if that will be added to the repo? celeba_conditional_sequence

    opened by dribnet 8
  • mistake in D(x,z) input size

    mistake in D(x,z) input size

    In table 5 from the paper you state that the input size for D(x,z) is 1024x1x1 which I think it's wrong after looking at the previous output sizes D(x) and D(z). I think that should be 1536x1x1.

    Is that assumption correct?

    opened by edgarriba 5
  • deserialization of models hangs

    deserialization of models hangs

    Training goes well for me using the scripts in experiments with the latest version of blocks, but then when I run any subsequent command that uses the generated model like scripts/sample or scripts/reconstruct, the command hangs indefinitely. My guess is that the deserialization is getting jammed up.

    I can look into it more - not yet familiar with the new tar format - but curious if this might be a known issue.

    opened by dribnet 3
  • Fuel version problem

    Fuel version problem

    I installed the current development version of fuel, but had some issue in fuel downloading.

    $ fuel-download celeba 64 $ fuel-convert celeba 64 $ fuel-download celeba 64 --clear

    The error message I got is: fuel-download: error: unrecognized arguments: 64 if I remove 64, I got: TypeError: init() got an unexpected keyword argument 'max_value'

    Could someone please specify what version or commits of fuel and progressbar should I use? Thanks

    opened by hope-yao 1
  • Where to use the reparametrization trick

    Where to use the reparametrization trick

    In the decoder module. I found that z is sampled from N(0, 1), so where did you use the reparametrization trick described in formual (2) and (3) in the paper

    opened by wuhaozhe 0
  • semi-supervised learning

    semi-supervised learning

    Hello,I read the paper and the source code.And it mentioned 'The last three hidden layers of the encoder as well as its output are concatenated to form a 8960-dimensional feature vector.' in section 4.3 of the paper.Could you please tell me how to compute the dimension?Thanks very much

    opened by C-xiaomeng 1
  • ImportError: No module named ali.utils

    ImportError: No module named ali.utils

    I followed the same steps in the readme file, but when I run this line

    $ THEANORC=theanorc python experiments/ali_cifar10.py

    I get:

    Traceback (most recent call last):
      File "experiments/ali_cifar10.py", line 3, in <module>
        from ali.utils import get_log_odds, conv_brick, conv_transpose_brick, bn_brick
    ImportError: No module named ali.utils
    
    opened by xtarx 0
  • Preprocess_representation has a bug for me

    Preprocess_representation has a bug for me

    Hi, I was trying to reproduce the representation learning results of paper. Everything works fine except "preprocess_representations" script. It is leading to this error:

    File "scripts/preprocess_representations", line 32, in preprocess_svhn bricks=[ali.encoder.layers[-9], ali.encoder.layers[-6], AttributeError: 'GaussianConditional' object has no attribute 'layers'

    Any help would be appreciated.

    opened by MarziEd 1
  • Semi-supervised learning

    Semi-supervised learning

    I've been trying to reproduce your figures for semi-supervised learning on CIFAR-10 (19.98% with 1000 labels). This result is based on the technique proposed in Salimans et al. (2016), not SVMs. Is there any way you can include your code, or at least any changes to the hyperparameters in ali_cifar10.py?

    Thanks in advance for your help.

    opened by christiancosgrove 7
Releases(v1)
Owner
Mohamed Ishmael Belghazi
Mohamed Ishmael Belghazi
This is a work in progress reimplementation of Instant Neural Graphics Primitives

Neural Hash Encoding This is a work in progress reimplementation of Instant Neural Graphics Primitives Currently this can train an implicit representa

Penn 79 Sep 01, 2022
A PyTorch Toolbox for Face Recognition

FaceX-Zoo FaceX-Zoo is a PyTorch toolbox for face recognition. It provides a training module with various supervisory heads and backbones towards stat

JDAI-CV 1.6k Jan 06, 2023
The Incredible PyTorch: a curated list of tutorials, papers, projects, communities and more relating to PyTorch.

This is a curated list of tutorials, projects, libraries, videos, papers, books and anything related to the incredible PyTorch. Feel free to make a pu

Ritchie Ng 9.2k Jan 02, 2023
How to Train a GAN? Tips and tricks to make GANs work

(this list is no longer maintained, and I am not sure how relevant it is in 2020) How to Train a GAN? Tips and tricks to make GANs work While research

Soumith Chintala 10.8k Dec 31, 2022
Pytorch implementation of COIN, a framework for compression with implicit neural representations 🌸

COIN 🌟 This repo contains a Pytorch implementation of COIN: COmpression with Implicit Neural representations, including code to reproduce all experim

Emilien Dupont 104 Dec 14, 2022
Neural Point-Based Graphics

Neural Point-Based Graphics Project   Video   Paper Neural Point-Based Graphics Kara-Ali Aliev1 Artem Sevastopolsky1,2 Maria Kolos1,2 Dmitry Ulyanov3

Ali Aliev 252 Dec 13, 2022
Official implementation of Few-Shot and Continual Learning with Attentive Independent Mechanisms

Few-Shot and Continual Learning with Attentive Independent Mechanisms This repository is the official implementation of Few-Shot and Continual Learnin

Chikan_Huang 25 Dec 08, 2022
RIFE - Real-Time Intermediate Flow Estimation for Video Frame Interpolation

RIFE - Real-Time Intermediate Flow Estimation for Video Frame Interpolation YouTube | BiliBili 16X interpolation results from two input images: Introd

旷视天元 MegEngine 28 Dec 09, 2022
Official repository of OFA. Paper: Unifying Architectures, Tasks, and Modalities Through a Simple Sequence-to-Sequence Learning Framework

Paper | Blog OFA is a unified multimodal pretrained model that unifies modalities (i.e., cross-modality, vision, language) and tasks (e.g., image gene

OFA Sys 1.4k Jan 08, 2023
Official pytorch implementation of Active Learning for deep object detection via probabilistic modeling (ICCV 2021)

Active Learning for Deep Object Detection via Probabilistic Modeling This repository is the official PyTorch implementation of Active Learning for Dee

NVIDIA Research Projects 130 Jan 06, 2023
CausalNLP is a practical toolkit for causal inference with text as treatment, outcome, or "controlled-for" variable.

CausalNLP CausalNLP is a practical toolkit for causal inference with text as treatment, outcome, or "controlled-for" variable. Install pip install -U

Arun S. Maiya 95 Jan 03, 2023
Syntax-Aware Action Targeting for Video Captioning

Syntax-Aware Action Targeting for Video Captioning Code for SAAT from "Syntax-Aware Action Targeting for Video Captioning" (Accepted to CVPR 2020). Th

59 Oct 13, 2022
details on efforts to dump the Watermelon Games Paprium cart

Reminder, if you like these repos, fork them so they don't disappear https://github.com/ArcadeHustle/WatermelonPapriumDump/fork Big thanks to Fonzie f

Hustle Arcade 29 Dec 11, 2022
Anonymous implementation of KSL

k-Step Latent (KSL) Implementation of k-Step Latent (KSL) in PyTorch. Representation Learning for Data-Efficient Reinforcement Learning [Paper] Code i

1 Nov 10, 2021
Library for fast text representation and classification.

fastText fastText is a library for efficient learning of word representations and sentence classification. Table of contents Resources Models Suppleme

Facebook Research 24.1k Jan 01, 2023
Skipgram Negative Sampling in PyTorch

PyTorch SGNS Word2Vec's SkipGramNegativeSampling in Python. Yet another but quite general negative sampling loss implemented in PyTorch. It can be use

Jamie J. Seol 287 Dec 14, 2022
Creating Multi Task Models With Keras

Creating Multi Task Models With Keras About The Project! I used the keras and Tensorflow Library, To build a Deep Learning Neural Network to Creating

Srajan Chourasia 4 Nov 28, 2022
Zero-shot Learning by Generating Task-specific Adapters

Code for "Zero-shot Learning by Generating Task-specific Adapters" This is the repository containing code for "Zero-shot Learning by Generating Task-s

INK Lab @ USC 11 Dec 17, 2021
Code for paper "Vocabulary Learning via Optimal Transport for Neural Machine Translation"

**Codebase and data are uploaded in progress. ** VOLT(-py) is a vocabulary learning codebase that allows researchers and developers to automaticaly ge

416 Jan 09, 2023
Parallel and High-Fidelity Text-to-Lip Generation; AAAI 2022 ; Official code

Parallel and High-Fidelity Text-to-Lip Generation This repository is the official PyTorch implementation of our AAAI-2022 paper, in which we propose P

Zhying 77 Dec 21, 2022