๐ฎ Matrix/Attention (Practice)
Companion to the Matrix Ops & Attention guide. Implement scaled dot-product attention โ the heart of transformers. Edit and run the code right here โ it executes in your browser.
๐ Your turnโ
Loading editorโฆ
๐ง Challenge yourselfโ
- Print the attention weight matrix and confirm rows sum to 1.
- Why the 1/sqrt(d) scaling? (gradient stability)
- Where does the O(n^2) cost come from, and how do sparse formats help?
Continue the learning path โ Beam Search