{"id":13422172,"url":"https://github.com/markdtw/matching-networks","last_synced_at":"2025-10-25T00:12:16.113Z","repository":{"id":93067252,"uuid":"96842325","full_name":"markdtw/matching-networks","owner":"markdtw","description":"Matching Networks for one-shot learning in tensorflow (NIPS'16)","archived":false,"fork":false,"pushed_at":"2019-02-02T15:32:14.000Z","size":11,"stargazers_count":56,"open_issues_count":4,"forks_count":25,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-27T22:32:17.463Z","etag":null,"topics":["few-shot-learning","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markdtw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-07-11T02:36:13.000Z","updated_at":"2024-06-25T13:37:25.000Z","dependencies_parsed_at":"2023-06-04T15:15:34.042Z","dependency_job_id":null,"html_url":"https://github.com/markdtw/matching-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/markdtw%2Fmatching-networks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdtw%2Fmatching-networks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdtw%2Fmatching-networks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markdtw%2Fmatching-networks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markdtw","download_url":"https://codeload.github.com/markdtw/matching-networks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224457311,"owners_count":17314447,"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","tensorflow"],"created_at":"2024-07-30T23:00:38.519Z","updated_at":"2025-10-25T00:12:16.017Z","avatar_url":"https://github.com/markdtw.png","language":"Python","funding_links":[],"categories":["Matching Networks for One Shot Learning. NIPS 2016"],"sub_categories":[],"readme":"# Matching Networks for One Shot Learning\nTensorflow implementation of [Matching Networks for One Shot Learning by Vinyals et al](https://arxiv.org/abs/1606.04080).\n\n## Prerequisites\n- Python 2.7+\n- [NumPy](http://www.numpy.org/)\n- [SciPy](https://www.scipy.org/)\n- [tqdm](https://pypi.python.org/pypi/tqdm)\n- [Tensorflow r1.0+](https://www.tensorflow.org/install/)\n\n\n## Data\n- [Omniglot](https://github.com/brendenlake/omniglot)\n\n\n## Preparation\n1. Download and extract omniglot dataset, modify `omniglot_train` and `omniglot_test` in `utils.py` to your location.\n\n2. First time training will generate `omniglot.npy` to the directory. The shape should be _(1632, 80, 28, 28, 1)_ , meaning 1623 classes, 20 * 4 90-degree-transforms (0, 90, 180, 270), height, width, channel. 1200 classes used for training and 423 used for testing.\n\n## Train\n```bash\npython main.py --train\n```\nTrain from a previous checkpoint at epoch X:\n```bash\npython main.py --train --modelpath=ckpt/model-X\n```\nCheck out tunable hyper-parameters:\n```bash\npython main.py\n```\n\n## Test\n```bash\npython main.py --eval\n```\n\n## Notes\n- The model will test the evaluation accuracy after every epoch.\n- As the paper indicated, training on Omniglot with FCE does not do any better but I still implemented them (as far as I'm concerned there are no repos that fully implement the FCEs by far).\n- The authors did not mentioned the value of time steps K in FCE_f, in the [sited paper](https://arxiv.org/abs/1511.06391), K is tested with 0, 1, 5, 10 as shown in table 1.\n- When using the data generated by myself (through `utils.py`), the evaluation accuracy at epoch 100 is around 82.00% (training accuracy 83.14%) without data augmentation.\n- Nevertheless, when using data provided by _zergylord_ in his [repo](https://github.com/zergylord/oneshot), this implementation can achieve up to 96.61% accuracy (training 97.22%) at epoch 100.\n- Issues are welcome!\n\n## Resources\n- [The paper](https://arxiv.org/abs/1606.04080).\n- Referred to [this repo](https://github.com/AntreasAntoniou/MatchingNetworks).\n- [Karpathy's note](https://github.com/karpathy/paper-notes/blob/master/matching_networks.md) helps a lot.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkdtw%2Fmatching-networks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkdtw%2Fmatching-networks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkdtw%2Fmatching-networks/lists"}