adjust figure width

This commit is contained in:
rasbt
2024-02-04 10:12:11 -06:00
parent 1653f6953a
commit bb50de7210

View File

@@ -21,7 +21,7 @@
"id": "7d4f11e0-4434-4979-9dee-e1207df0eb01",
"metadata": {},
"source": [
"<img src=\"figures/mental-model.webp\" width=500px>"
"<img src=\"figures/mental-model.webp\" width=450px>"
]
},
{
@@ -48,7 +48,7 @@
"id": "5c5213e9-bd1c-437e-aee8-f5e8fb717251",
"metadata": {},
"source": [
"<img src=\"figures/mental-model-2.webp\" width=300px>"
"<img src=\"figures/mental-model-2.webp\" width=350px>"
]
},
{
@@ -108,7 +108,7 @@
"id": "4adce779-857b-4418-9501-12a7f3818d88",
"metadata": {},
"source": [
"<img src=\"figures/chapter-steps.webp\" width=500px>"
"<img src=\"figures/chapter-steps.webp\" width=350px>"
]
},
{
@@ -173,7 +173,7 @@
"id": "9665e8ab-20ca-4100-b9b9-50d9bdee33be",
"metadata": {},
"source": [
"<img src=\"figures/gpt-in-out.webp\" width=300px>"
"<img src=\"figures/gpt-in-out.webp\" width=350px>"
]
},
{
@@ -271,7 +271,7 @@
"id": "314ac47a-69cc-4597-beeb-65bed3b5910f",
"metadata": {},
"source": [
"<img src=\"figures/layernorm.webp\" width=300px>"
"<img src=\"figures/layernorm.webp\" width=350px>"
]
},
{
@@ -357,7 +357,7 @@
"id": "570db83a-205c-4f6f-b219-1f6195dde1a7",
"metadata": {},
"source": [
"<img src=\"figures/layernorm2.webp\" width=300px>"
"<img src=\"figures/layernorm2.webp\" width=350px>"
]
},
{
@@ -528,7 +528,7 @@
"id": "e136cfc4-7c89-492e-b120-758c272bca8c",
"metadata": {},
"source": [
"<img src=\"figures/overview-after-ln.webp\" width=300px>"
"<img src=\"figures/overview-after-ln.webp\" width=350px>"
]
},
{
@@ -673,7 +673,7 @@
"id": "fdcaacfa-3cfc-4c9e-b668-b71a2753145a",
"metadata": {},
"source": [
"<img src=\"figures/ffn.webp\" width=300px>"
"<img src=\"figures/ffn.webp\" width=350px>"
]
},
{
@@ -703,7 +703,7 @@
"id": "8f8756c5-6b04-443b-93d0-e555a316c377",
"metadata": {},
"source": [
"<img src=\"figures/mental-model-3.webp\" width=500px>"
"<img src=\"figures/mental-model-3.webp\" width=350px>"
]
},
{
@@ -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",
"<img src=\"figures/shortcut-example.webp\" width=300px>"
"<img src=\"figures/shortcut-example.webp\" width=350px>"
]
},
{
@@ -849,7 +849,7 @@
"id": "36b64d16-94a6-4d13-8c85-9494c50478a9",
"metadata": {},
"source": [
"<img src=\"figures/transformer-block.webp\" width=300px>"
"<img src=\"figures/transformer-block.webp\" width=350px>"
]
},
{
@@ -909,7 +909,7 @@
"id": "9b7b362d-f8c5-48d2-8ebd-722480ac5073",
"metadata": {},
"source": [
"<img src=\"figures/gpt.webp\" width=300px>"
"<img src=\"figures/gpt.webp\" width=350px>"
]
},
{
@@ -1153,7 +1153,7 @@
"id": "0042c58e-995a-4a42-887f-613cad9f22b9",
"metadata": {},
"source": [
"<img src=\"figures/mental-model-final.webp\" width=300px>"
"<img src=\"figures/mental-model-final.webp\" width=350px>"
]
},
{
@@ -1177,7 +1177,7 @@
"id": "caade12a-fe97-480f-939c-87d24044edff",
"metadata": {},
"source": [
"<img src=\"figures/iterative-gen.webp\" width=300px>"
"<img src=\"figures/iterative-gen.webp\" width=350px>"
]
},
{
@@ -1196,7 +1196,7 @@
"id": "7ee0f32c-c18c-445e-b294-a879de2aa187",
"metadata": {},
"source": [
"<img src=\"figures/generate-text.webp\" width=600px>"
"<img src=\"figures/generate-text.webp\" width=350px>"
]
},
{
@@ -1239,7 +1239,7 @@
"source": [
"- The `generate_text_simple` above implements an iterative process, where it creates one token at a time\n",
"\n",
"<img src=\"figures/iterative-generate.webp\" width=400px>"
"<img src=\"figures/iterative-generate.webp\" width=350px>"
]
},
{
@@ -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)"