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
+12-6
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Few-shot learning methods address this challenge by learning an instance embeddi
7
7
8
8

9
9
10
-

10
+

11
11
12
12
### Prerequisites
13
13
@@ -43,7 +43,7 @@ We presume the input model is a GPU stored model.
43
43
### Model Training
44
44
45
45
#### FEAT Approach
46
-
To reproduce our experiments with FEAT, please use **train_feat.py** and follow the instructions blow. FEAT meta-learns the embedding adaptation process such that all the training instance embeddings in a task is adapted, based on their contextual task information, using Transformer. An extension FEAT$\star$, is also included, which incorporate the specific test instance in the context.
46
+
To reproduce our experiments with FEAT, please use **train_feat.py** and follow the instructions blow. FEAT meta-learns the embedding adaptation process such that all the training instance embeddings in a task is adapted, based on their contextual task information, using Transformer. An extension FEAT* (**train_feat_star.py**), is also included, which incorporates the specific test instance in the context.
47
47
48
48
The train_feat.py takes the following command line options:
49
49
@@ -63,6 +63,8 @@ The train_feat.py takes the following command line options:
63
63
64
64
-`temperature`: Temperature over the logits, we divide logits with this value, default to `1`
65
65
66
+
-`temperature2`: Temperature over the logits in the regularizer, we divide logits with this value, default to `16`. This is specially designed for FEAT (and in the train_feat.py).
67
+
66
68
-`model_type`: Two types of encoder, i.e., the convolution network and ResNet, default to `ConvNet`
67
69
68
70
-`dataset`: Option for the dataset (MiniImageNet or CUB), default to `MiniImageNet`
@@ -73,19 +75,23 @@ The train_feat.py takes the following command line options:
73
75
74
76
-`use_bilstm`: This is specially designed for Matching Network. If this is true, bi-LSTM is used for embedding adaptation. Default to `False`
75
77
76
-
-`lr_mul`: This is specially designed for Matching Network with bi-LSTM and FEAT. The learning rate for the top layer will be multiplied by this value (usually with faster learning rate). Default to `10`
78
+
-`lr_mul`: This is specially designed for Matching Network with bi-LSTM and FEAT variants. The learning rate for the top layer will be multiplied by this value (usually with faster learning rate). Default to `10`
77
79
78
-
-`balance`: This is the weights for the FEAT regularizer. Default to `10`
80
+
-`balance`: This is the weights for the FEAT variants regularizer. Default to `0.1` and `10` for FEAT and FEAT* respectively.
79
81
80
82
Running the command without arguments will train the models with the default hyperparamters values. Loss changes will be recorded as a tensorboard file in the ./runs folder.
81
83
82
84
For example, to train the 1-shot 5-way FEAT model with ConvNet backbone on MiniImageNet:
We implement two baseline approaches in this repo, i.e., the [Matching Network](https://arxiv.org/abs/1606.04080) and [Prototypical Network](https://arxiv.org/abs/1703.05175). To train the them on this task, cd into this repo's root folder and execute:
0 commit comments