GithubHelp home page GithubHelp logo

xiaoanshi / r2d2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bertinetto/r2d2

0.0 1.0 0.0 36 KB

[ICLR'19] Meta-learning with differentiable closed-form solvers

Home Page: http://www.robots.ox.ac.uk/~luca/r2d2.html

License: MIT License

Python 85.83% Shell 14.17%

r2d2's Introduction

Meta-learning with differentiable closed-form solvers.

Paper

Please refer to it as:

@inproceedings{
bertinetto2018metalearning,
title={Meta-learning with differentiable closed-form solvers},
author={Luca Bertinetto and Joao F. Henriques and Philip Torr and Andrea Vedaldi},
booktitle={International Conference on Learning Representations},
year={2019},
url={https://openreview.net/forum?id=HyxnZh0ct7},
}

Data setup

  • In scripts/train/conf/fewshots.yaml, specify the location of your custom $DATASET_PATH (data.root_dir).
  • Download Omniglot, CIFAR-FS and miniImageNet the above format. Original datasets from here and here.
  • Download and extract one or more datasets in your custom $DATASET_PATH folder, the code assumes the following structure (example):
$DATASET_PATH
├── miniimagenet
│   ├── data
│   │   ├── n01532829
|   |   |── ...
│   │   └── n13133613
│   ├── splits
│   │   └── ravi-larochelle
|   |   |   ├── train.txt
|   |   |   ├── val.txt
|   |   |   └── test.txt
├── omniglot
|   ...
├── cifarfs 
|   ...

Repo setup (with Conda)

  • Set up conda environment: conda env create -f environment.yml.
  • source activate fsrr
  • Install torchnet: pip install git+https://github.com/pytorch/tnt.git@master.
  • Install the repo package: pip install -e .
  • source deactivate fsrr

Run

scripts/train/experiments.sh contains all the experiments of the paper (train+eval) in blocks of three lines, e.g.

expm_folder=mini_r2d2 
python run_train.py --log.exp_dir $expm_folder --data.dataset miniimagenet --data.way 16 --model.drop 0.1 --base_learner.init_adj_scale 1e-4 
python ../eval/run_eval.py --data.test_episodes 10000 --data.test_way 5 --data.test_shot 1 --model.model_path ../train/results/$expm_folder/best_model.1shot.t7 
python ../eval/run_eval.py --data.test_episodes 10000 --data.test_way 5 --data.test_shot 5 --model.model_path ../train/results/$expm_folder/best_model.5shot.t7

Note

Some of the files of this repository (e.g. data loading and training boilerplate routines) are the result of a modification of prototypical networks code and contain a statement in their header.

r2d2's People

Contributors

bertinetto avatar

Watchers

James Cloos 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.