{"blog_title":"\u3089\u3093\u3060\u3080\u306a\u8a18\u61b6","categories":["machine_learning"],"image_url":"https://cdn-ak.f.st-hatena.com/images/fotolife/d/derwind/20211205/20211205212020.png","author_name":"derwind","type":"rich","url":"https://randommemory.hatenablog.com/entry/2021/12/05/212312","blog_url":"https://randommemory.hatenablog.com/","author_url":"https://blog.hatena.ne.jp/derwind/","width":"100%","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Frandommemory.hatenablog.com%2Fentry%2F2021%2F12%2F05%2F212312\" title=\"\u8a73\u89e3\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0 \u7b2c2\u7248 (8) - \u3089\u3093\u3060\u3080\u306a\u8a18\u61b6\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","height":"190","provider_url":"https://hatena.blog","provider_name":"Hatena Blog","published":"2021-12-05 21:23:12","version":"1.0","description":"Attention \u3092\u53ef\u8996\u5316\u3057\u305f\u3044\u306a\u3068\u601d\u3063\u305f\u306e\u3067\u3001\u30bc\u30ed\u3064\u304f 2 \u306e visualize_attention.py \u3092\u6d41\u7528\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3046\u3002\u305d\u306e\u305f\u3081\u306b\u30016/layers/torch/Attention.py \u306e\u307b\u3046\u3082\u6539\u9020\u304c\u5fc5\u8981\u3067\u3042\u308b\u3002 class Attention(nn.Module): def __init__(self, output_dim, hidden_dim, device='cpu'): ... # \u8ffd\u52a0 self.reset_attention_map() def forward(self, ht, hs, source=None): ... a = score / torch\u2026","title":"\u8a73\u89e3\u30c7\u30a3\u30fc\u30d7\u30e9\u30fc\u30cb\u30f3\u30b0 \u7b2c2\u7248 (8)"}