{"id":13698546,"url":"https://github.com/schatty/prototypical-networks-tf","last_synced_at":"2025-05-04T03:31:29.645Z","repository":{"id":39997613,"uuid":"178500400","full_name":"schatty/prototypical-networks-tf","owner":"schatty","description":"Implementation of Prototypical Networks for Few-shot Learning in TensorFlow 2.0","archived":false,"fork":false,"pushed_at":"2023-10-17T22:57:26.000Z","size":928,"stargazers_count":51,"open_issues_count":3,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-13T03:34:44.203Z","etag":null,"topics":["few-shot-learning","omniglot","one-shot-learning","prototypical-networks","tensorflow2"],"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/schatty.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-30T02:19:29.000Z","updated_at":"2024-05-03T08:16:46.000Z","dependencies_parsed_at":"2024-08-02T19:01:27.143Z","dependency_job_id":"946ffbd3-8077-40db-8982-8e3a8ef307c6","html_url":"https://github.com/schatty/prototypical-networks-tf","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/schatty%2Fprototypical-networks-tf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schatty%2Fprototypical-networks-tf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schatty%2Fprototypical-networks-tf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schatty%2Fprototypical-networks-tf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schatty","download_url":"https://codeload.github.com/schatty/prototypical-networks-tf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252283607,"owners_count":21723507,"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":["few-shot-learning","omniglot","one-shot-learning","prototypical-networks","tensorflow2"],"created_at":"2024-08-02T19:00:49.024Z","updated_at":"2025-05-04T03:31:28.098Z","avatar_url":"https://github.com/schatty.png","language":"Python","funding_links":[],"categories":["Model 💛💛💛💛💛\u003ca name=\"Model\" /\u003e"],"sub_categories":["Classification 分类"],"readme":"# Prototypical Networks for Few-shot in TensorFlow 2.0\nImplementation of Prototypical Networks for Few-shot Learning paper (https://arxiv.org/abs/1703.05175) in TensorFlow 2.0. Model has been tested on Omniglot and miniImagenet datasets with the same splitting as in the paper.\n\n\u003cimg width=\"896\" alt=\"Screenshot 2019-04-02 at 9 53 06 AM\" src=\"https://user-images.githubusercontent.com/23639048/55438102-5d9e4c00-55a9-11e9-86e2-b4f79f880b83.png\"\u003e\n\n### Dependencies and Installation\n* The code has been tested on Ubuntu 18.04 with Python 3.6.8 and TensorFflow 2.0.0-alpha0\n* The two main dependencies are TensorFlow and Pillow package (Pillow is included in dependencies)\n* To install `prototf` lib run `pytnon setup.py install`\n* Run `bash data/download_omniglot.sh` from repo's root directory to download Omniglot dataset\n* miniImagenet was downloaded from brilliant repo from `renmengye` (https://github.com/renmengye/few-shot-ssl-public) and placed into `data/mini-imagenet` folder\n\n### Repository Structure\n\nThe repository organized as follows. `data` directory contains scripts for dataset downloading and used as a default directory for datasets. `prototf` is the library containing the model itself (`prototf/models`) and logic for datasets loading and processing (`prototf/data`). `scripts` directory contains scripts for launching the training. `train/run_train.py` and `eval/run_eval.py` launch training and evaluation respectively. `tests` folder contains basic training procedure on small-valued parameters to check general correctness. `results` folder contains .md file with current configuration and details of conducted experiments.\n\n### Training\n\n* Training and evaluation configurations are specified through config files, each config describes single train+eval evnironment.\n* Run `python scripts/train/run_train.py --config scripts/config_omniglot.conf` to run training on Omniglot with default parameters.\n* Run `python scripts/train/run_train.py --config scripts/config_miniimagenet.conf` to run training on miniImagenet with default parmeters\n\n### Evaluating\n\n* Run `python scripts/eval/run_eval.py --config scripts/config_omniglot.conf` to run evaluation on Omniglot\n* Run `python scripts/eval/run_eval.py --config scripts/config_miniimagenet.conf` to run evaluation on miniImagenet\n\n### Tests\n\n* Run `python -m unittest tests/test_omniglot.py` from repo's root to test Omniglot\n* Run `python -m unittest tests/test_mini_imagenet.py` from repo's root test miniImagenet \n\n### Results\n\nOmniglot:\n\n| Evnironment                 | 5-way-5-shot     | 5-way-1-shot     | 20-way-5-shot    | 20-way-1shot     |\n|-----------------------------|------------------|------------------|------------------|------------------|\n| Accuracy                    | 99.4%            | 97.4%            | 98.4%            | 92.2%            |\n\nminiImagenet\n\n| Evnironment                 | 5-way-5-shot     | 5-way-1-shot     | \n|-----------------------------|------------------|------------------|\n| Accuracy                    | 66.0%            | 43.5%            |\n\nAdditional settings can be found in `results` folder in the root of repository. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschatty%2Fprototypical-networks-tf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschatty%2Fprototypical-networks-tf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschatty%2Fprototypical-networks-tf/lists"}