From 683703aaccd12cbbfc76c096a23b92cc91575d8f Mon Sep 17 00:00:00 2001 From: Emanuele Natale Date: Sat, 18 Mar 2023 20:28:55 +0100 Subject: [PATCH] Fix typo in "Mental model" formula --- modules/12-attention.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/12-attention.md b/modules/12-attention.md index 5795d92..f12f2be 100644 --- a/modules/12-attention.md +++ b/modules/12-attention.md @@ -65,7 +65,7 @@ with the convention that $X_t\in \mathbb{R}^d$ (resp. $Y_s\in \mathbb{R}^d$) is **Mental model for self-attention:** self-attention interpreted as taking expectation $$ y_s = \sum_{t=1}^T p(x_t | x_s) v(x_t) = \mathbb{E}[v(x) | x_s],\\ -\text{with, } p(x_t|x_s) = \frac{\exp(q(x_s)k(x_t))}{\sum_{r}q(x_s)k(x_r)}, +\text{with, } p(x_t|x_s) = \frac{\exp(q(x_s)k(x_t))}{\sum_{r}\exp(q(x_s)k(x_r))}, $$ where the mappings $q(.), k(.)$ and $v(.)$ represent query, key and value.