blue-blue272 / fewshot-CAN

Code of Cross Attention Network for Few-shot Classification (NeurIPS 2019).
206 stars 41 forks source link

a question about residual attention mechanism #11

Closed howyoungchen closed 3 years ago

howyoungchen commented 3 years ago

in the residual attention mechanism,the initial feature maps P and Q are elementwisely weighted by 1 + A^p and 1 + A^q. I guess that the linef1 = f1.unsqueeze(2) * a1.unsqueeze(3)in cam.py is the elementwisely weighted operation. However I can't find the operation of (1+) in your code.

I am deeply inspired by the excellent programming of this project. Thanks for your kindly sharing and look forward to your early reply.

blue-blue272 commented 3 years ago

It is in the line 52 in cam.py