{"url":"https://htn20190109.hatenablog.com/entry/2025/11/20/235639","version":"1.0","blog_title":"HTN20190109\u306e\u65e5\u8a18","author_name":"HTN20190109","width":"100%","height":"190","author_url":"https://blog.hatena.ne.jp/HTN20190109/","description":"import torchimport torch.nn as nnimport math # ==============================# Scaled Dot-Product Attention# ==============================class ScaledDotProductAttention(nn.Module): def __init__(self, scale_factor): super().__init__() self.scale_factor = scale_factor def forward(self, q, k, v): dk \u2026","published":"2025-11-20 23:56:39","provider_url":"https://hatena.blog","blog_url":"https://htn20190109.hatenablog.com/","type":"rich","title":"TransformerBlock","provider_name":"Hatena Blog","image_url":null,"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhtn20190109.hatenablog.com%2Fentry%2F2025%2F11%2F20%2F235639\" title=\"TransformerBlock - 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>","categories":["DL"]}