知识卡片
拼接多头后恢复特征维
若k个头各输出N×v矩阵,沿特征轴拼接得到N×kv,再经共享输出投影恢复N×d。书中式26.27拼接后的N×v标注遗漏了头数因子。先明确各头维度和拼接轴,才能正确设置输出映射及残差连接。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
where v is the dimensionality of the value vectors and d is the dimensionality of the code vectors of the output ([109] recommends setting kv = d). The matrix WMSA merges all the heads; its values are learnable parameters. The other learnable parameters of MSA are the query, key, and value projections for each of the k attention heads.
参考来源
- 位置:《Foundations of Computer Vision (Antonio Torralba, Phillip Isola etc.)》第26章《Transformer》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Foundations of Computer Vision (Antonio Torralba, Phillip Isola etc.)/_epub-src/OPS/xhtml/c026.xhtml)
- 结论依据:摘录中关于拼接多头后恢复特征维的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:where v is the dimensionality of the value vectors and d is the dimensionality of the code vectors of the output ([109] recommends setting kv = d). The matrix WMSA merges all the heads; its values are learnable parameters. The other learnable parameters of MSA are the query, key, and value projections for each of the k attention heads.