nmn2 icon indicating copy to clipboard operation
nmn2 copied to clipboard

How to visualize the attention map

Open its-dron opened this issue 8 years ago • 1 comments

I am attempting to visualize results, which is mostly handled by main.visualize(). However, the code to get the attention map has been commented out, and replaced with np.zeros.

My general question is what is the intuition behind the commented out code? Some specifics:

  • What is i_datum?
  • What is mod_layout_choice?
  • Why is att_blob_name created the way it is?

This will be helpful to understand, as we are also attempting to connect an additional model to the final attention map, pre softmax activation. Thanks.

its-dron avatar Apr 17 '17 18:04 its-dron

Same question here. When I uncomment the visualize lines, it goes to this error:

Traceback (most recent call last): File "main.py", line 260, in main() File "main.py", line 36, in main do_iter(task.val, model, config, vis=True) File "main.py", line 108, in do_iter visualize(batch_data, model) File "main.py", line 227, in visualize att_data = model.apollo_net.blobs[att_blob_name].data[i_datum,...] KeyError: 'Find_101_softmax'

I have no idea of the numbers such as "101". It seems that "Find_101_softmax" is not in the layer list.

ShangxuanWu avatar Apr 18 '17 17:04 ShangxuanWu