Code for the NIPS 2017 paper Prototypical Networks for Few-shot Learning.
If you use this code, please cite our paper:
@inproceedings{snell2017prototypical,
title={Prototypical Networks for Few-shot Learning},
author={Snell, Jake and Swersky, Kevin and Zemel, Richard},
booktitle={Advances in Neural Information Processing Systems},
year={2017}
}
pip install git+https://github.com/pytorch/tnt.git@master
.python setup.py install
or python setup.py develop
.sh download_omniglot.sh
.python scripts/train/few_shot/run_train.py
. This will run training and place the results into results
.
--log.exp_dir EXP_DIR
, where EXP_DIR
is your desired output directory.--data.cuda
.python scripts/train/few_shot/run_trainval.py
. This will save your model into results/trainval
by default.python scripts/predict/few_shot/run_eval.py --model.model_path results/trainval/best_model.pt
.