10.1.queries-keys-values
Sep 10, 2024
notesjulyfun技术学习d2l 1 Minutes
106 Words
This article was last updated on May 27, 2026 and some of the information may no longer be applicable due to the passage of time.
- 设想一个由 key, value 对组成数据库 。
- 某个实体可以对查询 q 和 返回权重
- 则定义 为 (即 value 的线性组合)

- 凸组合: 权重和为 1 且权重 ,可使用 softmax 来达成
- 这边定义的
show_heatmaps 函数输入矩阵为四维 (n, m, r, c),显示 个矩阵,每个矩阵长宽

Article title:10.1.queries-keys-values
Article author:Julyfun
Release time:Sep 10, 2024