Giter Club home page Giter Club logo

greedy_infomax's Introduction

Greedy InfoMax

We can train a neural network without end-to-end backpropagation and achieve competitive performance.

This repo provides the code for the experiments in our paper:

Sindy Löwe*, Peter O'Connor, Bastiaan S. Veeling* - Putting An End to End-to-End: Gradient-Isolated Learning of Representations

*equal contribution

What is Greedy InfoMax?

We simply divide existing architectures into gradient-isolated modules and optimize the mutual information between cross-patch intermediate representations.

The Greedy InfoMax Learning Approach

What we found exciting is that despite each module being trained greedily, it improves upon the representation of the previous module. This enables you to keep stacking modules until downstream performance saturates.

How to run the code

Dependencies

  • Python and Conda

  • Setup the conda environment infomax by running:

    bash setup_dependencies.sh

Additionally, for the audio experiments:

  • Install torchaudio in the infomax environment
  • Download audio datasets
    bash download_audio_data.sh

Usage

Vision Experiments

  • To replicate the vision results from our paper, run

    source activate infomax
    bash vision_traineval.sh

    This will train the Greedy InfoMax model as well as evaluate it by training a linear image classifiers on top of it

  • View all possible command-line options by running

    python -m GreedyInfoMax.vision.main_vision --help

    Some of the more important options are:

    • in order to train the baseline CPC model with end-to-end backpropagation instead of the Greedy InfoMax model set:
    --model_splits 1
    • If you want to save GPU memory, you can train layers sequentially, one at a time, by setting the module to be trained (0-2), e.g.
    --train_module 0

Audio Experiments

  • To replicate the audio results from our paper, run

    source activate infomax
    bash audio_traineval.sh

    This will train the Greedy InfoMax model as well as evaluate it by training two linear classifiers on top of it - one for speaker and one for phone classification.

  • View all possible command-line options by running

    python -m GreedyInfoMax.audio.main_audio --help

    Some of the more important options are:

    • in order to train the baseline CPC model with end-to-end backpropagation instead of the Greedy InfoMax model set:
    --model_splits 1
    • If you want to save GPU memory, you can train layers sequentially, one at a time, by setting the layer to be trained (0-5), e.g.
    --train_layer 0

Want to learn more about Greedy InfoMax?

Check out my blog post for an intuitive explanation of Greedy InfoMax.

Additionally, you can watch my presentation at NeurIPS 2019. My slides for this talk are available here.

Cite

Please cite our paper if you use this code in your own work:

@inproceedings{lowe2019putting,
  title={Putting an End to End-to-End: Gradient-Isolated Learning of Representations},
  author={L{\"o}we, Sindy and O'Connor, Peter and Veeling, Bastiaan},
  booktitle={Advances in Neural Information Processing Systems},
  pages={3039--3051},
  year={2019}
}

References

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.