Skip to content

alecwangcq/Prototypical-network

Repository files navigation

Protonet

Requirements:

  1. python==3.6
  2. pytorch 0.4.0
conda create -n protonet-env python=3.6
source activate protonet-env
pip install -r requirements.txt

miniImageNet

[Google Drive] (2.9 GB)

# Download and place "mini-imagenet.zip" in "PATH/TO/data/raw/mini-imagenet".
mkdir -p PATH/TO/data/raw/mini-imagenet
cd data/mini-imagenet
mv PATH/TO/mini-imagenet.zip  PATH/TO/data/raw/
unzip PATH/TO/data/raw/mini-imagenet.zip 
rm -f PATH/TO/data/raw/mini-imagenet.zip 

# Download and place Ravi split in "PATH/TO/data/splits/mini_imagenet_split"
git clone https://github.com/renmengye/few-shot-ssl-public
mkdir -p PATH/TO/data/splits/mini_imagenet_split
mv PATH/TO/few-shot-ssl-public/fewshot/data/mini_imagenet_split/Ravi PATH/TO/data/splits/mini_imagenet_split

# Prepare data
python prepro/gen_miniImageNet.py

Run:

python train_protonet.py --hparams=protonet_5way_1shot
python train_protonet.py --hparams=protonet_5way_5shot
...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages