{"id":13422179,"url":"https://github.com/jakesnell/prototypical-networks","last_synced_at":"2025-04-12T15:37:34.896Z","repository":{"id":37397018,"uuid":"109552139","full_name":"jakesnell/prototypical-networks","owner":"jakesnell","description":"Code for the NeurIPS 2017 Paper \"Prototypical Networks for Few-shot Learning\"","archived":false,"fork":false,"pushed_at":"2021-01-28T09:22:04.000Z","size":206,"stargazers_count":1158,"open_issues_count":26,"forks_count":261,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-03T16:11:27.925Z","etag":null,"topics":["deep-learning","few-shot","metric-learning","nips-2017","omniglot","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakesnell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-05T04:38:19.000Z","updated_at":"2025-03-28T02:46:55.000Z","dependencies_parsed_at":"2022-07-08T16:47:16.436Z","dependency_job_id":null,"html_url":"https://github.com/jakesnell/prototypical-networks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakesnell%2Fprototypical-networks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakesnell%2Fprototypical-networks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakesnell%2Fprototypical-networks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakesnell%2Fprototypical-networks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakesnell","download_url":"https://codeload.github.com/jakesnell/prototypical-networks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248590536,"owners_count":21129841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","few-shot","metric-learning","nips-2017","omniglot","pytorch"],"created_at":"2024-07-30T23:00:38.595Z","updated_at":"2025-04-12T15:37:34.861Z","avatar_url":"https://github.com/jakesnell.png","language":"Python","funding_links":[],"categories":["Prototypical Networks for Few-shot Learning. NIPS 2017"],"sub_categories":[],"readme":"# Prototypical Networks for Few-shot Learning\n\nCode for the NIPS 2017 paper [Prototypical Networks for Few-shot Learning](http://papers.nips.cc/paper/6996-prototypical-networks-for-few-shot-learning.pdf).\n\nIf you use this code, please cite our paper:\n\n```\n@inproceedings{snell2017prototypical,\n  title={Prototypical Networks for Few-shot Learning},\n  author={Snell, Jake and Swersky, Kevin and Zemel, Richard},\n  booktitle={Advances in Neural Information Processing Systems},\n  year={2017}\n }\n ```\n\n## Training a prototypical network\n\n### Install dependencies\n\n* This code has been tested on Ubuntu 16.04 with Python 3.6 and PyTorch 0.4.\n* Install [PyTorch and torchvision](http://pytorch.org/).\n* Install [torchnet](https://github.com/pytorch/tnt) by running `pip install git+https://github.com/pytorch/tnt.git@master`.\n* Install the protonets package by running `python setup.py install` or `python setup.py develop`.\n\n### Set up the Omniglot dataset\n\n* Run `sh download_omniglot.sh`.\n\n### Train the model\n\n* Run `python scripts/train/few_shot/run_train.py`. This will run training and place the results into `results`.\n  * You can specify a different output directory by passing in the option `--log.exp_dir EXP_DIR`, where `EXP_DIR` is your desired output directory.\n  * If you are running on a GPU you can pass in the option `--data.cuda`.\n* Re-run in trainval mode `python scripts/train/few_shot/run_trainval.py`. This will save your model into `results/trainval` by default.\n\n### Evaluate\n\n* Run evaluation as: `python scripts/predict/few_shot/run_eval.py --model.model_path results/trainval/best_model.pt`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakesnell%2Fprototypical-networks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakesnell%2Fprototypical-networks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakesnell%2Fprototypical-networks/lists"}