Giter VIP home page Giter VIP logo

residual_adapters's Introduction

Parametric families of deep neural networks with residual adapters

Pytorch backbone codes for the papers:

Page of our associated Visual Domain Decathlon challenge for multi-domain classification: http://www.robots.ox.ac.uk/~vgg/decathlon/

Abstract

A practical limitation of deep neural networks is their high degree of specialization to a single task and visual domain. To overcome this limitation, in these papers we propose to consider instead universal parametric families of neural networks, which still contain specialized problem-specific models, but differing only by a small number of parameters. We study different designs for such parametrizations, including series and parallel residual adapters. We show that, in order to maximize performance, it is necessary to adapt both shallow and deep layers of a deep network, but the required changes are very small. We also show that these universal parametrization are very effective for transfer learning, where they outperform traditional fine-tuning techniques.

Code

Requirements
Launching the code

First download the data with download_data.sh /path/to/save/data/. Please copy decathlon_mean_std.pickle to the data folder.

To train a dataset from scratch:

CUDA_VISIBLE_DEVICES=2 python train_new_task_from_scratch.py --dataset cifar100 --wd3x3 1. --wd 5. --mode bn

To train a dataset with parallel adapters put on a pretrained 'off the shelf' deep network:

CUDA_VISIBLE_DEVICES=2 python train_new_task_adapters.py --dataset cifar100 --wd1x1 1. --wd 5. --mode parallel_adapters --source /path/to/net

To train a dataset with series adapters put on a pretrained deep network (with adapters in it during pretraining):

CUDA_VISIBLE_DEVICES=2 python train_new_task_adapters.py --dataset cifar100 --wd1x1 1. --wd 5. --mode series_adapters --source /path/to/net

To train a dataset with series adapters put on a pretrained 'off the shelf' deep network:

CUDA_VISIBLE_DEVICES=2 python train_new_task_adapters.py --dataset cifar100 --wd1x1 1. --wd 5. --mode series_adapters --source /path/to/net

To train a dataset with normal finetuning from a pretrained deep network:

CUDA_VISIBLE_DEVICES=2 python train_new_task_finetuning.py --dataset cifar100 --wd 5. --mode bn --source /path/to/net

Pretrained networks

We pretrained networks on ImageNet (with reduced resolution):

Results of the commands above with the pretrained networks

So we train on CIFAR 100 and evaluate on the eval split:

Val. Acc.
Scratch 75.23
Parallel adapters 80.62
Series adapters 80.17
Series adapters (off the shelf) 70.97
Normal finetuning 78.62

If you consider citing us

For the Visual Domain Decathlon challenge and the series adapters:

    @inproceedings{Rebuffi17,
      author       = "Rebuffi, S-A and Bilen, H. and Vedaldi, A.",
      title        = "Learning multiple visual domains with residual adapters",
      booktitle    = "Advances in Neural Information Processing Systems",
      year         = "2017",
    }

For the parallel adapters:

    @inproceedings{ rebuffi-cvpr2018,
    author = { Sylvestre-Alvise Rebuffi and Hakan Bilen and Andrea Vedaldi },
    title = {Efficient parametrization of multi-domain deep neural networks},
    booktitle = CVPR,
    year = 2018,
    }

residual_adapters's People

Contributors

srebuffi avatar

Watchers

 avatar  avatar  avatar

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.