Code for the ICML 2019 paper TapNet: Neural Network Augmented with Task-Adaptive Projection for Few-Shot Learning
- This code is tested on Ubuntu 16.04 with Python 3.6 and chainer 5.20
#Download and unzip "mini-imagenet.tar.gz" from Google Drive link [mini-ImageNet]
#Place train.npz
, val.npz
, test.npz
files in TapNet/miniImageNet_TapNet/data
#Download and unzip "tiered-imagenet.tar.gz" from Google Drive link [tiered-ImageNet]
#Place images .npz
and labels .pkl
files in TapNet/tieredImageNet_TapNet/data
#For miniImageNet experiment
cd /TapNet/miniImageNet_TapNet/scripts
python train_TapNet_miniImageNet.py --gpu {GPU device number}
--n_shot {n_shot}
--nb_class_train {number of classes in training}
--nb_class_test {number of classes in test}
--n_query_train {number of queries per class in training}
--n_query_test {number of queries per class in test}
--wd_rate {Weight decay rate}
#For tieredImageNet experiment
cd /TapNet/tieredImageNet_TapNet/scripts
python train_TapNet_tieredImageNet.py --gpu {GPU device number}
--n_shot {n_shot}
--nb_class_train {number of classes in training}
--nb_class_test {number of classes in test}
--n_query_train {number of queries per class in training}
--n_query_test {number of queries per class in test}
--wd_rate {Weight decay rate}