Hi, @AlexHex7 . I was confused how to implement visualization of the Nonlocal Map.
As for the Nonlocal Map of Net.nl_2 layer, which size is (49, 9), and the code you released first reshapes each row of nl_map to (3, 3) and converts it to (56, 56, 3) as the resized-input image. Then directly add the image and heat_map by a weighted sum to obtain img_add as the attention visualization for current query rect[(y0, x0), (y1, x1)].
Why each row of nl_map can represent the attention of current query?
Hi, @AlexHex7 . I was confused how to implement visualization of the Nonlocal Map.
As for the Nonlocal Map of
Net.nl_2
layer, which size is(49, 9)
, and the code you released first reshapes each row ofnl_map
to(3, 3)
and converts it to(56, 56, 3)
as the resized-input image. Then directly add the image and heat_map by a weighted sum to obtainimg_add
as the attention visualization for currentquery rect[(y0, x0), (y1, x1)]
.Why
each row of nl_map
can represent theattention of current query
?