- Notifications
You must be signed in to change notification settings - Fork266
Code for the NeurIPS 2017 Paper "Prototypical Networks for Few-shot Learning"
License
NotificationsYou must be signed in to change notification settings
jakesnell/prototypical-networks
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Code for the NIPS 2017 paperPrototypical 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} }
- This code has been tested on Ubuntu 16.04 with Python 3.6 and PyTorch 0.4.
- InstallPyTorch and torchvision.
- Installtorchnet by running
pip install git+https://github.com/pytorch/tnt.git@master
. - Install the protonets package by running
python setup.py install
orpython setup.py develop
.
- Run
sh download_omniglot.sh
.
- Run
python scripts/train/few_shot/run_train.py
. This will run training and place the results intoresults
.- You can specify a different output directory by passing in the option
--log.exp_dir EXP_DIR
, whereEXP_DIR
is your desired output directory. - If you are running on a GPU you can pass in the option
--data.cuda
.
- You can specify a different output directory by passing in the option
- Re-run in trainval mode
python scripts/train/few_shot/run_trainval.py
. This will save your model intoresults/trainval
by default.
- Run evaluation as:
python scripts/predict/few_shot/run_eval.py --model.model_path results/trainval/best_model.pt
.
About
Code for the NeurIPS 2017 Paper "Prototypical Networks for Few-shot Learning"
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.