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
Thank you alot for sharing this code. I was wondering, How I can extract the attention scores from the network? What I mean is, How did you calculated the image in the description based on the importance of patches?
#17
Open
narminGhaffari opened this issue
Feb 18, 2021
· 2 comments
The text was updated successfully, but these errors were encountered:
narminGhaffari
changed the title
Thank you alot for sharing this code.
Thank you alot for sharing this code. I was wondering, How I can extract the attention scores from the network? What I mean is, How did you calculated the image in the description based on the importance of patches?
Feb 18, 2021
Thank you a lot for sharing this code. I was wondering, How I can extract the attention scores from the network? What I mean is, How did you calculate the image in the description based on the importance of patches?
Hi, you can get model output ak for each patch in the bag by using the following function:
get_alpha_layer_output = K.function([model.layers[0].input], [model.layers[10].output])
Then you need to rescal the ak to get the attention weight as described in the paper (Fig.5). The heatmap is produced by multiplying the patch and its corresponding attention weight.
No description provided.
The text was updated successfully, but these errors were encountered: