Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yinboc/prototypical-network-pytorch
A re-implementation of "Prototypical Networks for Few-shot Learning"
https://github.com/yinboc/prototypical-network-pytorch
few-shot-learning machine-learning pytorch
Last synced: about 7 hours ago
JSON representation
A re-implementation of "Prototypical Networks for Few-shot Learning"
- Host: GitHub
- URL: https://github.com/yinboc/prototypical-network-pytorch
- Owner: yinboc
- License: mit
- Created: 2018-07-07T04:51:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-26T07:13:45.000Z (over 4 years ago)
- Last Synced: 2024-08-10T07:01:16.414Z (3 months ago)
- Topics: few-shot-learning, machine-learning, pytorch
- Language: Python
- Homepage:
- Size: 174 KB
- Stars: 298
- Watchers: 6
- Forks: 60
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-few-shot-meta-learning - code (PyTorch)
README
# Prototypical Network
A re-implementation of [Prototypical Network](https://arxiv.org/abs/1703.05175).
With ConvNet-4 backbone on miniImageNet.
***For deep backbones (ResNet), see [Meta-Baseline](https://github.com/cyvius96/few-shot-meta-baseline).***
### Results
1-shot: 49.1% (49.4% in the paper)
5-shot: 66.9% (68.2% in the paper)
## Environment
* python 3
* pytorch 0.4.0## Instructions
1. Download the images: https://drive.google.com/open?id=0B3Irx3uQNoBMQ1FlNXJsZUdYWEE
2. Make a folder `materials/images` and put those images into it.
`--gpu` to specify device for program.
### 1-shot Train
`python train.py`
### 1-shot Test
`python test.py`
### 5-shot Train
`python train.py --shot 5 --train-way 20 --save-path ./save/proto-5`
### 5-shot Test
`python test.py --load ./save/proto-5/max-acc.pth --shot 5`