If we have a set of feature maps with dimensions [B, C, H, W] (batch, channel, height, width), why do we transform our feature maps before we calculate their affinity/correlation in attention mechanisms? What makes this better than simply taking the cosine distance between the original feature vectors (e.g. resizing the maps to [B, C, HW] and [B, HW, C] and multiplying them together). Aren't the feature maps already in an appropriate feature/embedding space that we can just use them directly instead of transforming them first?

  • $\begingroup$ I think you already asked this question? perhaps you are splitting the question into two as somebody requested. In that case, you should be aware that (1) you can edit questions, and (2) questions are forever so you can't leave extra duplicate ones lying around. (either make it not a duplicate or delete it) $\endgroup$
    – user253751
    Aug 3 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.