Skip to content
A re-implementation of "Prototypical Networks for Few-shot Learning"
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
materials first commit Jul 7, 2018
LICENSE Create LICENSE Apr 23, 2019
README.md Update README.md Jul 24, 2019
convnet.py Update BN init for pytorch 1.2 Sep 19, 2019
mini_imagenet.py first commit Jul 7, 2018
samplers.py first commit Jul 7, 2018
test.py improve memory usage Nov 25, 2018
train.py improve memory usage Nov 25, 2018
utils.py mkdir -> makedirs Jul 24, 2019

README.md

Prototypical Network

A re-implementation of Prototypical Network.

Evaluated on Mini-ImageNet.

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

You can’t perform that action at this time.