Git Product home page Git Product logo

e3bm-1's Introduction

An Ensemble of Epoch-wise Empirical Bayes for Few-shot Learning

LICENSE Python PyTorch

Paper: https://arxiv.org/pdf/1904.08479 (last revised 16 Mar 2020)

This repository contains the PyTorch implementation for the Paper "An Ensemble of Epoch-wise Empirical Bayes for Few-shot Learning". If you have any questions on this repository or the related paper, feel free to create an issue or send me an email.
Email address: yaoyao.liu (at) mpi-inf.mpg.de

Summary

Introduction

Few-shot learning aims to train efficient predictive models with a few examples. The lack of training data leads to poor models that perform high-variance or low-confidence predictions. In this paper, we propose to meta-learn the ensemble of epoch-wise empirical Bayes models (E3BM) to achieve robust predictions. "Epoch-wise" means that each training epoch has a Bayes model whose parameters are specifically learned and deployed. "Empirical" means that the hyperparameters, e.g., used for learning and ensembling the epoch-wise models, are generated by hyperprior learners conditional on task-specific data. We introduce four kinds of hyperprior learners by considering inductive vs. transductive, and epoch-dependent vs. epoch-independent, in the paradigm of meta-learning. We conduct extensive experiments for five-class few-shot tasks on three challenging benchmarks: miniImageNet, tieredImageNet, and FC100, and achieve top performance using the epoch-dependent transductive hyperprior learner, which captures the richest information. Our ablation study shows that both "epoch-wise ensemble" and "empirical" encourage high efficiency and robustness in the model performance.

Figure: Conceptual illustrations of the model adaptation on the blue, red and yellow tasks. (a) MAML is the classical inductive method that meta-learns a network initialization θ that is used to learn a single base-learner on each task. (b) SIB is a transductive method that formulates a variational posterior as a function of both labeled training data T(tr) and unlabeled test data x (te). It also uses a single base-learner and optimizes the learner by running several synthetic gradient steps on x(te). (c) Our E3BM is a generic method that learns to combine the epoch-wise base-learners, and to generate task-specific learningcrates α and combination weights v that encourage robust adaptation.

Installation

In order to run this repository, we advise you to install python 3.6 and PyTorch 1.2.0 with Anaconda. You may download Anaconda and read the installation instruction on their official website: https://www.anaconda.com/download/

Create a new environment and install PyTorch and torchvision on it:

conda create --name e3bm-pytorch python=3.6
conda activate e3bm-pytorch
conda install pytorch=1.2.0 
conda install torchvision -c pytorch

Install other requirements:

pip install -r requirements.txt

Running Experiments

Run meta-training with default settings (data and pre-trained model will be downloaded automatically):

python main.py --phase_sib=meta_train

Run meta-test with our checkpoint (data and the checkpoint will be downloaded automatically):

python main.py --phase_sib=meta_eval

Run meta-test with other checkpoints:

python main.py --phase_sib=meta_eval --meta_eval_load_path=<your_ckpt_dir>

Citation

Please cite our paper if it is helpful to your work:

@article{Liu2020E3BM
  author    = {Yaoyao Liu and
               Bernt Schiele and
               Qianru Sun},
  title     = {An Ensemble of Epoch-wise Empirical Bayes for Few-shot Learning},
  journal   = {arXiv},
  volume    = {1904.08479},
  year      = {2020},
  url       = {http://arxiv.org/abs/1904.08479}
}

Acknowledgements

Our implementations use the source code from the following repositories and users:

e3bm-1's People

Contributors

yaoyao-liu avatar qianrusun1015 avatar

Stargazers

Nikolaos Dionelis 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.