Sha-Lab / FEAT

The code repository for "Few-Shot Learning via Embedding Adaptation with Set-to-Set Functions"
MIT License
418 stars 84 forks source link

Key and value intuition of transformer in FEAT #66

Closed kumam92 closed 3 years ago

kumam92 commented 3 years ago

Transformer in FEAT model compares query image feature vector with all support set feature vector. I got the idea that query image is Q of the transformer. So what is the key and value, I think support set are key or value. I wanted to understand which component of FSL is key, and what is value for Transformer? Or key and value are same in this case?

Han-Jia commented 3 years ago

Hi,

Transformer uses the self-attention module. The key and value are the same, i.e., the embeddings of the support set.

kumarmanas commented 3 years ago

Correct me if I am wrong, I think key and value are not the same. Looks like key is 'feature' and V is 'class'. Can you please clarify if they are same or my assumption is correct?

Han-Jia commented 3 years ago

Hi,

In our implementation, we compute prototypes of each class at first and then adapt embeddings with transformer on those prototypes (we keep key = value = prototypes)