attention-is-all-you-need-pytorch icon indicating copy to clipboard operation
attention-is-all-you-need-pytorch copied to clipboard

Attention weight plot

Open liperrino opened this issue 4 years ago • 3 comments

Please, how to add Attention weight plot to this code. Thanks in advance

liperrino avatar Sep 03 '19 17:09 liperrino

you can get attention weight by this code below,

model.(enc|dec)oder.forward([target sequences], return_attns=True)

and then, as you know, can visualize attention weight by using seaborn, or such like that.

seiichiinoue avatar Sep 06 '19 09:09 seiichiinoue

you can get attention weight by this code below,

model.(enc|dec)oder.forward([target sequences], return_attns=True)

and then, as you know, can visualize attention weight by using seaborn, or such like that.

Thanks very much. Please is that line locate in the code: model.(enc|dec)oder.forward([target sequences], return_attns=True)

liperrino avatar Feb 03 '20 12:02 liperrino

you can get attention weight by this code below,

model.(enc|dec)oder.forward([target sequences], return_attns=True)

and then, as you know, can visualize attention weight by using seaborn, or such like that.

Is it after training or when training. I'm new in it so i don't really understand how it works. I am trying to get it.

liperrino avatar Feb 03 '20 12:02 liperrino