请在仅使用 numpy 的前提下,实现单头 Scaled−Dot Product Attention 的前向计算。
输入为 Query(Q),Key(K),Value(V) 三矩阵和可选 attention_mask 。
设 dk=d 。
1.缩放点积得分 S=dkQKT
Scan the QR code below with WeChat to sign in
First-time scan will create your account automatically
请使用微信扫描下方二维码完成注册