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


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 Update Jul 24, 2019 Update BN init for pytorch 1.2 Sep 19, 2019 first commit Jul 7, 2018 first commit Jul 7, 2018 improve memory usage Nov 25, 2018 improve memory usage Nov 25, 2018 mkdir -> makedirs Jul 24, 2019

Prototypical Network

A re-implementation of Prototypical Network.

Evaluated on Mini-ImageNet.


1-shot: 49.1% (49.4% in the paper)

5-shot: 66.9% (68.2% in the paper)


  • python 3
  • pytorch 0.4.0


  1. Download the images:

  2. Make a folder materials/images and put those images into it.

--gpu to specify device for program.

1-shot Train


1-shot Test


5-shot Train

python --shot 5 --train-way 20 --save-path ./save/proto-5

5-shot Test

python --load ./save/proto-5/max-acc.pth --shot 5

You can’t perform that action at this time.