Official PyTorch implementation of the paper Recognition-by-Components for Interpretable Few-Shot Learning.
Python 3.8, Pytorch 1.7.0, timm 0.3.2
Please follow mini-imagenet-tools to obtain the miniImageNet dataset and put it in ./datasets/mini/.
Please follow tiered-imagenet-tools to obtain the tieredImageNet dataset and put it in ./datasets/tiered/.
Please follow download_cifar_fs.sh to obtain the CIFAR-FS dataset and put it in ./datasets/cifarfs/.
Please follow download_fc100.sh to obtain the FC100 dataset and put it in ./datasets/fc100/.
Please follow https://github.com/mrkshllr/FewTURE/tree/main to pretrain the backbone ViT-small and put it in ./initialization/miniimagenet.
Please see ./run.sh.
-
Please refer to https://github.com/mrkshllr/FewTURE/tree/main to download the miniImageNet dataset and the checkpoint of the corresponding pretrained ViT-small model.
-
Put them in the corresponding folders.
-
Run ./run.sh in bash shell.