rename batch to text

This commit is contained in:
rasbt
2024-04-02 20:46:53 -05:00
parent 21140b98d4
commit cd12b4a937

View File

@@ -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": {