ethancaballero / Improved-Dynamic-Memory-Networks-DMN-plus

Theano Implementation of DMN+ (Improved Dynamic Memory Networks) from the paper by Xiong, Merity, & Socher at MetaMind, http://arxiv.org/abs/1603.01417 (Dynamic Memory Networks for Visual and Textual Question Answering)
168 stars 63 forks source link

Visualization of attention layer #6

Closed wanmeiziyoulan closed 6 years ago

wanmeiziyoulan commented 7 years ago

Hi, The paper provide the comparison of original images and attention images, How to obtain visualization of attention layer? Could you please share some code about it? Thanks.

ethancaballero commented 6 years ago

"attentions": np.array([ret[2]]) returns how much each sentence is attended to: https://github.com/ethancaballero/Improved-Dynamic-Memory-Networks-DMN-plus/blob/master/dmn_tied.py#L642 https://github.com/ethancaballero/Improved-Dynamic-Memory-Networks-DMN-plus/blob/master/dmn_untied.py#L646