You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+36-43
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,42 @@
1
1
# Few-Shot Learning via Embedding Adaptation with Set-to-Set Functions
2
-
The code repository for "[Few-Shot Learning via Embedding Adaptation with Set-to-Set Functions](https://arxiv.org/abs/1812.03664)" (Accepted by CVPR 2020) in PyTorch.
2
+
The code repository for "[Few-Shot Learning via Embedding Adaptation with Set-to-Set Functions](https://arxiv.org/abs/1812.03664)" (Accepted by CVPR 2020) in PyTorch. If you use any content of this repo for your work, please cite the following bib entry:
3
3
4
-
## Few-Shot Embedding Adaptation with Transformer
4
+
@inproceedings{ye2020fewshot,
5
+
author = {Han-Jia Ye and
6
+
Hexiang Hu and
7
+
De-Chuan Zhan and
8
+
Fei Sha},
9
+
title = {Few-Shot Learning via Embedding Adaptation with Set-to-Set Functions},
10
+
booktitle = {Computer Vision and Pattern Recognition (CVPR)},
11
+
year = {2020}
12
+
}
5
13
6
-
Learning with limited data is a key challenge for visual recognition. Many few-shot learning methods address this challenge by learning an instance embedding function from seen classes and apply the function to instances from unseen classes with limited labels. This style of transfer learning is task-agnostic: the embedding function is not learned optimally discriminative with respect to the unseen classes, where discerning among them leads to the target task. In this paper, we propose a novel approach to adapt the instance embeddings to the target classification task with a #set-to-set# function, yielding embeddings that are task-specific and are discriminative. We empirically investigated various instantiations of such set-to-set functions and observed the Transformer is most effective --- as it naturally satisfies key properties of our desired model. We denote this model as FEAT (few-shot embedding adaptation w/ Transformer) and validate it on both the standard few-shot classification benchmark and four extended few-shot learning settings with essential use cases, i.e., cross-domain, transductive, generalized few-shot learning, and low-shot learning. It archived consistent improvements over baseline models as well as previous methods and established the new state-of-the-art results on two benchmarks.
14
+
## Few-Shot Embedding Adaptation with Set-to-Set Functions
7
15
8
-

16
+
We propose a novel model-based approach to adapt the instance embeddings to the target classification task with a #set-to-set# function, yielding embeddings that are task-specific and are discriminative. We empirically investigated various instantiations of such set-to-set functions and observed the Transformer is most effective --- as it naturally satisfies key properties of our desired model. We denote our method as Few-shot Embedding Adaptation with Transformer (FEAT).
9
17
10
18

11
19
20
+
## Results
21
+
22
+
Results on the MiniImageNet with ResNet-12 backbone:
23
+
| Setups | 1-Shot 5-Way | 5-Shot 5-Way | Link to Weights |
The following packages are required to run the scripts:
@@ -49,7 +77,7 @@ Please use **train_fsl.py** and follow the instructions below. FEAT meta-learns
49
77
#### Arguments
50
78
The train_fsl.py takes the following command line options (details are in the `model/utils.py`):
51
79
52
-
## Task Related Arguments ##
80
+
**Task Related Arguments**
53
81
-`dataset`: Option for the dataset (`MiniImageNet`, `TieredImageNet`, or `CUB`), default to `MiniImageNet`
54
82
55
83
-`way`: The number of classes in a few-shot task during meta-training, default to `5`
@@ -64,7 +92,7 @@ The train_fsl.py takes the following command line options (details are in the `m
64
92
65
93
-`eval_query`: Number of instances in each class to evaluate the performance during meta-test, default to `15`
66
94
67
-
## Optimization Related Arguments ##
95
+
**Optimization Related Arguments**
68
96
-`max_epoch`: The maximum number of training epochs, default to `200`
69
97
70
98
-`episodes_per_epoch`: The number of tasks sampled in each epoch, default to `100`
@@ -89,7 +117,7 @@ The train_fsl.py takes the following command line options (details are in the `m
89
117
90
118
-`weight_decay`: The weight_decay value for SGD optimizer, default to `0.0005`
91
119
92
-
## Model Related Arguments ##
120
+
**Model Related Arguments**
93
121
-`model_class`: The model to use during meta-learning. We provide implementations for baselines (`MatchNet` and `ProtoNet`), set-to-set functions (`BILSTM`, `DeepSet`, `GCN`, and our `FEAT`). We also include an instance-specific embedding adaptation approach `FEAT`, which is discussed in the old version of the paper. Default to `FEAT`
94
122
95
123
-`use_euclidean`: Use the euclidean distance or the cosine similarity to compute pairwise distances. We use the euclidean distance in the paper. Default to `False`
@@ -102,7 +130,7 @@ The train_fsl.py takes the following command line options (details are in the `m
102
130
103
131
-`temperature2`: Temperature over the logits in the regularizer, we divide logits with this value. This is specially designed for the contrastive regularizer. Default to `1`
104
132
105
-
## Other Arguments ##
133
+
**Other Arguments**
106
134
-`orig_imsize`: Whether to resize the images before loading the data into the memory. `-1` means we do not resize the images and do not read all images into the memory. Default to `-1`
107
135
108
136
-`multi_gpu`: Whether to use multiple gpus during meta-training, default to `False`
@@ -134,41 +162,6 @@ to train the 1-shot/5-shot 5-way FEAT model with ResNet-12 backbone on TieredIma
0 commit comments