Home

Awesome

Few-Shot Learning Through an Information Retrieval Lens

This repository contains the code for the paper "Few-Shot Learning Through an Information Retrieval Lens". Eleni Triantafillou, Richard Zemel, Raquel Urtasun arXiv preprint.

Prerequisites

Setting up

The code assumes the existence of a directory named data within the few_shot_mAP_public directory. data contains 3 subdirectories: omniglot and mini_imagenet, containing the corresponding datasets, and another directory called dataset_splits also containing subdirectories for omniglot and mini_imagenet containing the data splits for these datasets (.csv files indicating which classes are meant to be used for training / validation / testing).

This structure will be created by running the provided setup script. Please modify the first 4 lines of this script to add the paths to the Omniglot and mini-ImageNet datasets and their corresponding splits (the datasets and splits are not provided in this repository).

cd few_shot_mAP_public
./setup.sh

If you'd like to monitor the training progress via Deep Dashboard, please follow these instructions:

DASHBOARD_LOC = "/u/eleni/public_html/results/few_shot_mAP/"

Reproducing our results

The experiements in the paper can be reproduced by running

python run_train.py

with the appropriate tf.FLAGS set to point to the correct dataset and model. A config file will then be looked up (among the files in few_shot_mAP_public/src/configs) based on these two pieces of information and the settings in that file will be used for training.

To evaluate a trained model on the benchmark tasks, you can run

python run_eval.py

Similarly as before, this requires setting the appropriate dataset and model so that the corresponding config file and model can be looked up.