From c518adb0b78d799c0619c413e91c5afd7f746fc0 Mon Sep 17 00:00:00 2001 From: Xiaotian Ma <44010854+xiaotian0328@users.noreply.github.com> Date: Tue, 26 Dec 2023 22:05:21 -0600 Subject: [PATCH 1/2] Update ch03.ipynb --- ch03/01_main-chapter-code/ch03.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch03/01_main-chapter-code/ch03.ipynb b/ch03/01_main-chapter-code/ch03.ipynb index 6d39da1..2fcee0d 100644 --- a/ch03/01_main-chapter-code/ch03.ipynb +++ b/ch03/01_main-chapter-code/ch03.ipynb @@ -306,7 +306,7 @@ "attn_weights_2 = torch.softmax(attn_scores_2, dim=0)\n", "\n", "print(\"Attention weights:\", attn_weights_2)\n", - "print(\"Sum:\", attn_weights.sum())" + "print(\"Sum:\", attn_weights_2.sum())" ] }, { From b8901da362db0615818adcda96c3278fe7d28ca8 Mon Sep 17 00:00:00 2001 From: Xiaotian Ma <44010854+xiaotian0328@users.noreply.github.com> Date: Tue, 26 Dec 2023 22:41:54 -0600 Subject: [PATCH 2/2] Update ch03.ipynb --- ch03/01_main-chapter-code/ch03.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ch03/01_main-chapter-code/ch03.ipynb b/ch03/01_main-chapter-code/ch03.ipynb index 2fcee0d..60628bc 100644 --- a/ch03/01_main-chapter-code/ch03.ipynb +++ b/ch03/01_main-chapter-code/ch03.ipynb @@ -527,7 +527,7 @@ } ], "source": [ - "all_context_vecs = attn_scores @ inputs\n", + "all_context_vecs = attn_weights @ inputs\n", "print(all_context_vecs)" ] },