From bb50de72106022d316647fb888c1954a5085cf18 Mon Sep 17 00:00:00 2001 From: rasbt Date: Sun, 4 Feb 2024 10:12:11 -0600 Subject: [PATCH] adjust figure width --- ch04/01_main-chapter-code/ch04.ipynb | 58 ++++++++++------------------ 1 file changed, 20 insertions(+), 38 deletions(-) diff --git a/ch04/01_main-chapter-code/ch04.ipynb b/ch04/01_main-chapter-code/ch04.ipynb index bcc54c8..b32f1a6 100644 --- a/ch04/01_main-chapter-code/ch04.ipynb +++ b/ch04/01_main-chapter-code/ch04.ipynb @@ -21,7 +21,7 @@ "id": "7d4f11e0-4434-4979-9dee-e1207df0eb01", "metadata": {}, "source": [ - "" + "" ] }, { @@ -48,7 +48,7 @@ "id": "5c5213e9-bd1c-437e-aee8-f5e8fb717251", "metadata": {}, "source": [ - "" + "" ] }, { @@ -108,7 +108,7 @@ "id": "4adce779-857b-4418-9501-12a7f3818d88", "metadata": {}, "source": [ - "" + "" ] }, { @@ -173,7 +173,7 @@ "id": "9665e8ab-20ca-4100-b9b9-50d9bdee33be", "metadata": {}, "source": [ - "" + "" ] }, { @@ -271,7 +271,7 @@ "id": "314ac47a-69cc-4597-beeb-65bed3b5910f", "metadata": {}, "source": [ - "" + "" ] }, { @@ -357,7 +357,7 @@ "id": "570db83a-205c-4f6f-b219-1f6195dde1a7", "metadata": {}, "source": [ - "" + "" ] }, { @@ -528,7 +528,7 @@ "id": "e136cfc4-7c89-492e-b120-758c272bca8c", "metadata": {}, "source": [ - "" + "" ] }, { @@ -673,7 +673,7 @@ "id": "fdcaacfa-3cfc-4c9e-b668-b71a2753145a", "metadata": {}, "source": [ - "" + "" ] }, { @@ -703,7 +703,7 @@ "id": "8f8756c5-6b04-443b-93d0-e555a316c377", "metadata": {}, "source": [ - "" + "" ] }, { @@ -725,7 +725,7 @@ "- This is achieved by adding the output of one layer to the output of a later layer, usually skipping one or more layers in between\n", "- Let's illustrate this idea with a small example network:\n", "\n", - "" + "" ] }, { @@ -849,7 +849,7 @@ "id": "36b64d16-94a6-4d13-8c85-9494c50478a9", "metadata": {}, "source": [ - "" + "" ] }, { @@ -909,7 +909,7 @@ "id": "9b7b362d-f8c5-48d2-8ebd-722480ac5073", "metadata": {}, "source": [ - "" + "" ] }, { @@ -1153,7 +1153,7 @@ "id": "0042c58e-995a-4a42-887f-613cad9f22b9", "metadata": {}, "source": [ - "" + "" ] }, { @@ -1177,7 +1177,7 @@ "id": "caade12a-fe97-480f-939c-87d24044edff", "metadata": {}, "source": [ - "" + "" ] }, { @@ -1196,7 +1196,7 @@ "id": "7ee0f32c-c18c-445e-b294-a879de2aa187", "metadata": {}, "source": [ - "" + "" ] }, { @@ -1239,7 +1239,7 @@ "source": [ "- The `generate_text_simple` above implements an iterative process, where it creates one token at a time\n", "\n", - "" + "" ] }, { @@ -1277,20 +1277,10 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "id": "a72a9b60-de66-44cf-b2f9-1e638934ada4", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Output: tensor([[15496, 11, 314, 716, 27018, 24086, 47843, 30961, 42348, 7267,\n", - " 49706, 43231, 47062, 34657]])\n", - "Output length: 14\n" - ] - } - ], + "outputs": [], "source": [ "model.eval() # disable dropout\n", "\n", @@ -1315,18 +1305,10 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": null, "id": "053d99f6-5710-4446-8d52-117fb34ea9f6", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Hello, I am Featureiman Byeswickattribute argue logger Normandy Compton analogous\n" - ] - } - ], + "outputs": [], "source": [ "decoded_text = tokenizer.decode(out.squeeze(0).tolist())\n", "print(decoded_text)"