{"description":"import numpy as np def softmax(x): # \u6570\u5024\u5b89\u5b9a\u5316 x = x - np.max(x, axis=1, keepdims=True) return np.exp(x) / np.sum(np.exp(x), axis=1, keepdims=True) def forward(hs, h): \"\"\" hs: (N, T, H) \u5168\u6642\u523b\u306e\u96a0\u308c\u72b6\u614b h : (N, H) \u73fe\u5728\u306e\u96a0\u308c\u72b6\u614b \"\"\" N, T, H = hs.shape # h\u3092(T\u65b9\u5411\u306b)\u62e1\u5f35 hr = h.reshape(N, 1, H).repeat(T, axis=1) # \u5185\u7a4d\uff08\u8981\u7d20\u7a4d \u2192 \u548c\u2026","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhtn20190109.hatenablog.com%2Fentry%2F2026%2F05%2F06%2F104111\" title=\"\u30b0\u30ed\u30fc\u30d0\u30eb\u30a2\u30c6\u30f3\u30b7\u30e7\u30f3\u30e2\u30c7\u30eb - HTN20190109\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_name":"Hatena Blog","title":"\u30b0\u30ed\u30fc\u30d0\u30eb\u30a2\u30c6\u30f3\u30b7\u30e7\u30f3\u30e2\u30c7\u30eb","width":"100%","author_name":"HTN20190109","type":"rich","blog_title":"HTN20190109\u306e\u65e5\u8a18","url":"https://htn20190109.hatenablog.com/entry/2026/05/06/104111","published":"2026-05-06 10:41:11","categories":["DL"],"provider_url":"https://hatena.blog","image_url":null,"blog_url":"https://htn20190109.hatenablog.com/","author_url":"https://blog.hatena.ne.jp/HTN20190109/","version":"1.0","height":"190"}