A re-implementation of Prototypical Network.
With ConvNet-4 backbone on miniImageNet.
1-shot: 49.1% (49.4% in the paper)
5-shot: 66.9% (68.2% in the paper)
train__bak.py is the origin file, and train.py is modified from train_bak.py.
train.py can get more than 50% 1-shot-5-way acc!!!!
1-shot: 50.17% (49.4% in the paper)(you can get the result less than 100 epoch!)
5-shot: 68.11% (68.2% in the paper)
- python 3.6
- pytorch 1.2.0
-
Download the images: https://drive.google.com/open?id=0B3Irx3uQNoBMQ1FlNXJsZUdYWEE
-
Make a folder
materials/imagesand put those images into it.
--gpu to specify device for program.
python train.py
python test.py
python train.py --shot 5 --train-way 30 --save-path ./save/proto-5
python test.py --load ./save/proto-5/max-acc.pth --shot 5
python show-logresult.py --load ./save/proto-5/trlog
The following repos are added in this work.
cyvius96/prototypical-network-pytorch: https://github.com/cyvius96/prototypical-network-pytorch