Skip to content
Chainer Implementation of TapNet: Neural Network Augmented with Task-Adaptive Projection for Few-Shot Learning
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
miniImageNet_TapNet
tieredImageNet_TapNet
README.md

README.md

TapNet: Neural Network Augmented with Task-Adaptive Projection for Few-Shot Learning

Code for the ICML 2019 paper TapNet: Neural Network Augmented with Task-Adaptive Projection for Few-Shot Learning

Dependencies

  • This code is tested on Ubuntu 16.04 with Python 3.6 and chainer 5.20

Data

miniImageNet

#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

tieredImageNet

#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

Running the code

#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}
You can’t perform that action at this time.