Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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} }

Training a prototypical network

Install dependencies

  • This code has been tested on Ubuntu 16.04 with Python 3.6 and PyTorch 0.4.
  • InstallPyTorch and torchvision.
  • Installtorchnet by runningpip install git+https://github.com/pytorch/tnt.git@master.
  • Install the protonets package by runningpython setup.py install orpython setup.py develop.

Set up the Omniglot dataset

  • Runsh download_omniglot.sh.

Train the model

  • Runpython 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.
  • Re-run in trainval modepython scripts/train/few_shot/run_trainval.py. This will save your model intoresults/trainval by default.

Evaluate

  • 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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp