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
Implementation of the "PSTNet: Point Spatio-Temporal Convolution on Point Cloud Sequences" paper.

PSTNet: Point Spatio-Temporal Convolution on Point Cloud Sequences Introduction Point cloud sequences are irregular and unordered in the spatial dimen

Hehe Fan 63 Dec 09, 2022
App customer segmentation cohort rfm clustering

CUSTOMER SEGMENTATION COHORT RFM CLUSTERING TỔNG QUAN VỀ HỆ THỐNG DỮ LIỆU Nên chuyển qua theme màu dark thì sẽ nhìn đẹp hơn https://customer-segmentat

hieulmsc 3 Dec 18, 2021
A basic implementation of Layer-wise Relevance Propagation (LRP) in PyTorch.

Layer-wise Relevance Propagation (LRP) in PyTorch Basic unsupervised implementation of Layer-wise Relevance Propagation (Bach et al., Montavon et al.)

Kai Fabi 28 Dec 26, 2022
Pytorch implementation of Deep Recursive Residual Network for Super Resolution (DRRN)

DRRN-pytorch This is an unofficial implementation of "Deep Recursive Residual Network for Super Resolution (DRRN)", CVPR 2017 in Pytorch. [Paper] You

yun_yang 192 Dec 12, 2022
A general and strong 3D object detection codebase that supports more methods, datasets and tools (debugging, recording and analysis).

ALLINONE-Det ALLINONE-Det is a general and strong 3D object detection codebase built on OpenPCDet, which supports more methods, datasets and tools (de

Michael.CV 5 Nov 03, 2022
A Decentralized Omnidirectional Visual-Inertial-UWB State Estimation System for Aerial Swar.

Omni-swarm A Decentralized Omnidirectional Visual-Inertial-UWB State Estimation System for Aerial Swarm Introduction Omni-swarm is a decentralized omn

HKUST Aerial Robotics Group 99 Dec 23, 2022
Super Resolution for images using deep learning.

Neural Enhance Example #1 — Old Station: view comparison in 24-bit HD, original photo CC-BY-SA @siv-athens. As seen on TV! What if you could increase

Alex J. Champandard 11.7k Dec 29, 2022
A curated list of neural rendering resources.

Awesome-of-Neural-Rendering A curated list of neural rendering and related resources. Please feel free to pull requests or open an issue to add papers

Zhiwei ZHANG 43 Dec 09, 2022
Puzzle-CAM: Improved localization via matching partial and full features.

Puzzle-CAM The official implementation of "Puzzle-CAM: Improved localization via matching partial and full features".

Sanghyun Jo 150 Nov 14, 2022
Some pvbatch (paraview) scripts for postprocessing OpenFOAM data

pvbatchForFoam Some pvbatch (paraview) scripts for postprocessing OpenFOAM data For every script there is a help message available: pvbatch pv_state_s

Morev Ilya 2 Oct 26, 2022
RobustVideoMatting and background composing in one model by using onnxruntime.

RVM_onnx_compose RobustVideoMatting and background composing in one model by using onnxruntime. Usage pip install -r requirements.txt python infer_cam

Quantum Liu 4 Apr 07, 2022
Repositorio de los Laboratorios de Análisis Numérico / Análisis Numérico I de FAMAF, UNC.

Repositorio de los Laboratorios de Análisis Numérico / Análisis Numérico I de FAMAF, UNC. Para los Laboratorios de la materia, vamos a utilizar el len

Luis Biedma 18 Dec 12, 2022
Categorizing comments on YouTube into different categories.

Youtube Comments Categorization This repo is for categorizing comments on a youtube video into different categories. negative (grievances, complaints,

Rhitik 5 Nov 26, 2022
A2LP for short, ECCV2020 spotlight, Investigating SSL principles for UDA problems

Label-Propagation-with-Augmented-Anchors (A2LP) Official codes of the ECCV2020 spotlight (label propagation with augmented anchors: a simple semi-supe

20 Oct 27, 2022
Tracking code for the winner of track 1 in the MMP-Tracking Challenge at ICCV 2021 Workshop.

Tracking Code for the winner of track1 in MMP-Trakcing challenge This repository contains our tracking code for the Multi-camera Multiple People Track

DamoCV 29 Nov 13, 2022
Attentive Implicit Representation Networks (AIR-Nets)

Attentive Implicit Representation Networks (AIR-Nets) Preprint | Supplementary | Accepted at the International Conference on 3D Vision (3DV) teaser.mo

29 Dec 07, 2022
Baseline and template code for node21 detection track

Nodule Detection Algorithm This codebase implements a baseline model, Faster R-CNN, for the nodule detection track in NODE21. It contains all necessar

node21challenge 11 Jan 15, 2022
Draw like Bob Ross using the power of Neural Networks (With PyTorch)!

Draw like Bob Ross using the power of Neural Networks! (+ Pytorch) Learning Process Visualization Getting started Install dependecies Requires python3

Kendrick Tan 116 Mar 07, 2022
Methods to get the probability of a changepoint in a time series.

Bayesian Changepoint Detection Methods to get the probability of a changepoint in a time series. Both online and offline methods are available. Read t

Johannes Kulick 554 Dec 30, 2022
This is Unofficial Repo. Lips Don't Lie: A Generalisable and Robust Approach to Face Forgery Detection (CVPR 2021)

Lips Don't Lie: A Generalisable and Robust Approach to Face Forgery Detection This is a PyTorch implementation of the LipForensics paper. This is an U

Minha Kim 2 May 11, 2022