Readability and code quality improvements (#959)

* Consistent dataset naming

* consistent section headers
This commit is contained in:
Sebastian Raschka
2026-02-17 19:44:56 -05:00
committed by GitHub
parent 7b1f740f74
commit be5e2a3331
48 changed files with 419 additions and 297 deletions

View File

@@ -101,6 +101,7 @@
"id": "0d824183-145c-4865-89e1-1f0d0a338f19"
},
"source": [
" \n",
"## 5.1 Evaluating generative text models"
]
},
@@ -121,6 +122,7 @@
"id": "bdc1cf3f-82d8-46c7-9ecc-58979ce87cdd"
},
"source": [
" \n",
"### 5.1.1 Using GPT to generate text"
]
},
@@ -253,14 +255,6 @@
"- The next chapters on finetuning LLMs will also introduce additional ways to measure model quality"
]
},
{
"cell_type": "markdown",
"id": "955f9e1a-7bf7-40d8-b1fa-eacabdee8d8e",
"metadata": {},
"source": [
"<br>"
]
},
{
"cell_type": "markdown",
"id": "0f3d7ea2-637f-4490-bc76-e361fc81ae98",
@@ -268,6 +262,7 @@
"id": "0f3d7ea2-637f-4490-bc76-e361fc81ae98"
},
"source": [
"&nbsp;\n",
"### 5.1.2 Calculating the text generation loss: cross-entropy and perplexity"
]
},
@@ -763,6 +758,7 @@
"id": "2ec6c217-e429-40c7-ad71-5d0a9da8e487"
},
"source": [
"&nbsp;\n",
"### 5.1.3 Calculating the training and validation set losses"
]
},
@@ -1220,6 +1216,7 @@
"id": "b9339f8d-00cb-4206-af67-58c32bd72055"
},
"source": [
"&nbsp;\n",
"## 5.2 Training an LLM"
]
},
@@ -1490,6 +1487,7 @@
"id": "699f45fc-bf78-42f2-bd24-2355db41b28f"
},
"source": [
"&nbsp;\n",
"## 5.3 Decoding strategies to control randomness"
]
},
@@ -1558,6 +1556,7 @@
"id": "4bb6f380-a798-4fd9-825c-17b7cd29a994",
"metadata": {},
"source": [
"&nbsp;\n",
"### 5.3.1 Temperature scaling"
]
},
@@ -1837,6 +1836,7 @@
"id": "c6e4873e-07e4-4abb-85df-bdaedcc1a6f7",
"metadata": {},
"source": [
"&nbsp;\n",
"### 5.3.2 Top-k sampling"
]
},
@@ -1957,6 +1957,7 @@
"id": "56056503-a15d-4315-a3ff-46647a4c7c45",
"metadata": {},
"source": [
"&nbsp;\n",
"### 5.3.3 Modifying the text generation function"
]
},
@@ -2054,6 +2055,7 @@
"id": "4e2002ca-f4c1-48af-9e0a-88bfc163ba0b",
"metadata": {},
"source": [
"&nbsp;\n",
"## 5.4 Loading and saving model weights in PyTorch"
]
},
@@ -2164,6 +2166,7 @@
"id": "4194350e-0409-4a63-8ffd-d3a896509032",
"metadata": {},
"source": [
"&nbsp;\n",
"## 5.5 Loading pretrained weights from OpenAI"
]
},
@@ -2615,6 +2618,7 @@
"id": "f2a66474-230d-4180-a8ff-843e04f1f1c4",
"metadata": {},
"source": [
"&nbsp;\n",
"## Summary and takeaways"
]
},

View File

@@ -62,7 +62,8 @@
"id": "5fea8be3-30a1-4623-a6d7-b095c6c1092e",
"metadata": {},
"source": [
"# Exercise 5.1: Temperature-scaled softmax scores and sampling probabilities"
"&nbsp;\n",
"## Exercise 5.1: Temperature-scaled softmax scores and sampling probabilities"
]
},
{
@@ -239,7 +240,8 @@
"id": "b510ffb0-adca-4d64-8a12-38c4646fd736",
"metadata": {},
"source": [
"# Exercise 5.2: Different temperature and top-k settings"
"&nbsp;\n",
"## Exercise 5.2: Different temperature and top-k settings"
]
},
{
@@ -258,7 +260,8 @@
"id": "3f35425d-529d-4179-a1c4-63cb8b25b156",
"metadata": {},
"source": [
"# Exercise 5.3: Deterministic behavior in the decoding functions"
"&nbsp;\n",
"## Exercise 5.3: Deterministic behavior in the decoding functions"
]
},
{
@@ -425,7 +428,8 @@
"id": "6d0480e5-fb4e-41f8-a161-7ac980d71d47",
"metadata": {},
"source": [
"# Exercise 5.4: Continued pretraining"
"&nbsp;\n",
"## Exercise 5.4: Continued pretraining"
]
},
{
@@ -598,7 +602,8 @@
"id": "3384e788-f5a1-407c-8dd1-87959b75026d",
"metadata": {},
"source": [
"# Exercise 5.5: Training and validation set losses of the pretrained model"
"&nbsp;\n",
"## Exercise 5.5: Training and validation set losses of the pretrained model"
]
},
{
@@ -874,7 +879,8 @@
"id": "3a76a1e0-9635-480a-9391-3bda7aea402d",
"metadata": {},
"source": [
"# Exercise 5.6: Trying larger models"
"&nbsp;\n",
"## Exercise 5.6: Trying larger models"
]
},
{
@@ -1028,7 +1034,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.16"
"version": "3.13.5"
}
},
"nbformat": 4,