All Projects → apple → ml-afv

apple / ml-afv

Licence: other
No description or website provided.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to ml-afv

NSL
Implementation for <Neural Similarity Learning> in NeurIPS'19.
Stars: ✭ 33 (-25%)
Mutual labels:  neurips-2019
DeepIPR
This is the code repo of our NeurIPS2019 work that proposes novel passport-based DNN ownership verification schemes, i.e. we embed passport layer into various deep learning architectures (e.g. AlexNet, ResNet) for Intellectual Property Right (IPR) protection.
Stars: ✭ 63 (+43.18%)
Mutual labels:  neurips-2019
batchbald redux
Reusable BatchBALD implementation
Stars: ✭ 44 (+0%)
Mutual labels:  neurips-2019
Generalizing-Lottery-Tickets
This repository contains code to replicate the experiments given in NeurIPS 2019 paper "One ticket to win them all: generalizing lottery ticket initializations across datasets and optimizers"
Stars: ✭ 48 (+9.09%)
Mutual labels:  neurips-2019
CoPINet
Learning Perceptual Inference by Contrasting
Stars: ✭ 24 (-45.45%)
Mutual labels:  neurips-2019

Adversarial Fisher Vectors for Unsupervised Representation Learning

This software project accompanies the research paper, Adversarial Fisher Vectors for Unsupervised Representation Learning.

We include sample code that can be used to train a GAN/EBM optionally with the MCMC inspired objective, and compute the Adversarial Fisher Vectors for linear classification.

Citation

@article{zhai2019adversarial,
  title={Adversarial Fisher Vectors for Unsupervised Representation Learning},
  author={Zhai, Shuangfei and Talbott, Walter and Guestrin, Carlos and Susskind, Joshua M},
  booktitle={Advances in neural information processing systems},
  year={2019}
}

Adversarial Fisher Vectors

Adversarial Fisher Vectors (AVFs) provide a way of utilizing a trained GAN by extracting representations from it. AFVs achieve this by adopting an EBM view of a common GAN implementation, and represent an example with the derived Fisher Score, nomalized by the Fisher Information. In this repo, we demonstrate the use of AFVs by providing sample code for traing a GAN and linear classification on CIFAR10 with the induced representation. We also provide pretrained weights of a GAN on the combined CIFAR10 and CIFAR100 dataset, which yields state-of-the-art linear classification results on the two datasets.

Setup

This code is written in Pytorch with Python 2.7. It's tested on Ubuntu 16.04 and CUDA 8.0 (but later versions should work too), and requires one GPU card. Run the following command to install all the dependencies:

pip install -r requirements.txt

Getting Started

GAN Training (optional)

In order to compute the AFVs, the first step is to train a GAN (and interpret it as an EBM) on CIFAR10. A model with default setting can be trained by running:

python main.py

One can also skip this step by using the pretrained model found under the checkpoints directory.

Linear Classifier

After a model is trained, we can load the a checkpoint (e.g., the one from the last iteration) and use it for training a linear classifier. This can be done by running:

python classifiy_cifar10.py --netG [path-to-generator-ckpt] --netD [path-to-discriminator-ckpt]

If using the pretrained model, this corresponds to:

python classifiy_cifar10.py --netG checkpoints/netG_pretrained.pth --netD checkpoints/netD_pretrained.pth

This will train a linear SVM classifier with dropout on the induced AFVs. Using the pretrained weights, this should give you a test accuracy of ~0.89. Note that this step is pretty time consuming, as the AFVs are of very high dimensionality and need to be generated online.

License

This sample code is released under the LICENSE terms.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].