From e14585e954801d616100736b3514b698714b1662 Mon Sep 17 00:00:00 2001 From: rasbt Date: Tue, 2 Apr 2024 20:46:53 -0500 Subject: [PATCH] rename batch to text --- ch05/01_main-chapter-code/ch05.ipynb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ch05/01_main-chapter-code/ch05.ipynb b/ch05/01_main-chapter-code/ch05.ipynb index 89240d9..2def63d 100644 --- a/ch05/01_main-chapter-code/ch05.ipynb +++ b/ch05/01_main-chapter-code/ch05.ipynb @@ -450,19 +450,19 @@ "name": "stdout", "output_type": "stream", "text": [ - "Batch 1: tensor([7.4541e-05, 3.1061e-05, 1.1563e-05])\n", - "Batch 2: tensor([3.9836e-05, 1.6783e-05, 4.7559e-06])\n" + "Text 1: tensor([7.4541e-05, 3.1061e-05, 1.1563e-05])\n", + "Text 2: tensor([3.9836e-05, 1.6783e-05, 4.7559e-06])\n" ] } ], "source": [ - "batch_idx = 0\n", - "target_probas_1 = probas[batch_idx, [0, 1, 2], targets[batch_idx]]\n", - "print(\"Batch 1:\", target_probas_1)\n", + "text_idx = 0\n", + "target_probas_1 = probas[text_idx, [0, 1, 2], targets[text_idx]]\n", + "print(\"Text 1:\", target_probas_1)\n", "\n", - "batch_idx = 1\n", - "target_probas_2 = probas[1, [0, 1, 2], targets[1]]\n", - "print(\"Batch 2:\", target_probas_2)" + "text_idx = 1\n", + "target_probas_2 = probas[text_idx, [0, 1, 2], targets[text_idx]]\n", + "print(\"Text 2:\", target_probas_2)" ] }, { @@ -476,7 +476,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 11, "id": "31402a67-a16e-4aeb-977e-70abb9c9949b", "metadata": { "colab": {