第11章注意機構とTransformer
11.3.6. Exercises11.3.6 練習問題
- Implement distance-based attention by modifying the
DotProductAttentioncode. Note that you only need the squared norms of the keys for an efficient implementation.英語のヒント
DotProductAttentionのコードを変えて、距離にもとづく注意を実装せよ。効率的な実装には、キーの2乗ノルムだけが必要であることに注意せよ。 - Modify the dot product attention to allow for queries and keys of different dimensionalities by employing a matrix to adjust dimensions.
英語のヒント
次元を合わせる行列を使って、クエリとキーの次元が異なっても扱えるように内積注意を変えよ。 - How does the computational cost scale with the dimensionality of the keys, queries, values, and their number? What about the memory bandwidth requirements?
英語のヒント
計算の費用は、キー、クエリ、バリューの次元とその数に応じてどう増えるか。メモリ帯域幅の要件はどうか。