Skip to content

Commit 5723c38

Browse files
committed
restruture old ch02 into appendix A
1 parent d66b235 commit 5723c38

19 files changed

+27
-25
lines changed

ch02/03_main-chapter-code/ch02-DDP-script.py renamed to appendix-A/03_main-chapter-code/DDP-script.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Appendix A: Introduction to PyTorch (Part 3)
2+
13
import torch
24
import torch.nn.functional as F
35
from torch.utils.data import Dataset, DataLoader

ch02/03_main-chapter-code/ch02-code-part1.ipynb renamed to appendix-A/03_main-chapter-code/code-part1.ipynb

+20-20
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
"id": "ca7fc8a0-280c-4979-b0c7-fc3a99b3b785",
66
"metadata": {},
77
"source": [
8-
"# Chapter 2: Introduction to PyTorch (Part 1)"
8+
"# Appendix A: Introduction to PyTorch (Part 1)"
99
]
1010
},
1111
{
1212
"cell_type": "markdown",
1313
"id": "f5bf13d2-8fc2-483e-88cc-6b4310221e68",
1414
"metadata": {},
1515
"source": [
16-
"## 2.1 What is PyTorch"
16+
"## A.1 What is PyTorch"
1717
]
1818
},
1919
{
@@ -59,15 +59,15 @@
5959
"id": "2100cf2e-7459-4ab3-92a8-43e86ab35a9b",
6060
"metadata": {},
6161
"source": [
62-
"## 2.2 Understanding tensors"
62+
"## A.2 Understanding tensors"
6363
]
6464
},
6565
{
6666
"cell_type": "markdown",
6767
"id": "26d7f785-e048-42bc-9182-a556af6bb7f4",
6868
"metadata": {},
6969
"source": [
70-
"### 2.2.1 Scalars, vectors, matrices, and tensors"
70+
"### A.2.1 Scalars, vectors, matrices, and tensors"
7171
]
7272
},
7373
{
@@ -148,7 +148,7 @@
148148
"id": "63dec48d-2b60-41a2-ac06-fef7e718605a",
149149
"metadata": {},
150150
"source": [
151-
"### 2.2.2 Tensor data types"
151+
"### A.2.2 Tensor data types"
152152
]
153153
},
154154
{
@@ -213,7 +213,7 @@
213213
"id": "2020deb5-aa02-4524-b311-c010f4ad27ff",
214214
"metadata": {},
215215
"source": [
216-
"### 2.2.3 Common PyTorch tensor operations"
216+
"### A.2.3 Common PyTorch tensor operations"
217217
]
218218
},
219219
{
@@ -378,7 +378,7 @@
378378
"id": "4c15bdeb-78e2-4870-8a4f-a9f591666f38",
379379
"metadata": {},
380380
"source": [
381-
"## 2.3 Seeing models as computation graphs"
381+
"## A.3 Seeing models as computation graphs"
382382
]
383383
},
384384
{
@@ -415,7 +415,7 @@
415415
"id": "f9424f26-2bac-47e7-b834-92ece802247c",
416416
"metadata": {},
417417
"source": [
418-
"## 2.4 Automatic differentiation made easy"
418+
"## A.4 Automatic differentiation made easy"
419419
]
420420
},
421421
{
@@ -481,7 +481,7 @@
481481
"id": "f53bdd7d-44e6-40ab-8a5a-4eef74ef35dc",
482482
"metadata": {},
483483
"source": [
484-
"## 2.5 Implementing multilayer neural networks"
484+
"## A.5 Implementing multilayer neural networks"
485485
]
486486
},
487487
{
@@ -709,7 +709,7 @@
709709
"id": "19858180-0f26-43a8-b2c3-7ed40abf9f85",
710710
"metadata": {},
711711
"source": [
712-
"## 2.6 Setting up efficient data loaders"
712+
"## A.6 Setting up efficient data loaders"
713713
]
714714
},
715715
{
@@ -884,7 +884,7 @@
884884
"id": "d904ca82-e50f-4f3d-a3ac-fc6ca53dd00e",
885885
"metadata": {},
886886
"source": [
887-
"## 2.7 A typical training loop"
887+
"## A.7 A typical training loop"
888888
]
889889
},
890890
{
@@ -1127,7 +1127,7 @@
11271127
"id": "4d5cd469-3a45-4394-944b-3ce543f41dac",
11281128
"metadata": {},
11291129
"source": [
1130-
"## 2.8 Saving and loading models"
1130+
"## A.8 Saving and loading models"
11311131
]
11321132
},
11331133
{
@@ -1167,55 +1167,55 @@
11671167
"id": "f891c013-43da-4a05-973d-997be313d2d8",
11681168
"metadata": {},
11691169
"source": [
1170-
"## 2.9 Optimizing training performance with GPUs"
1170+
"## A.9 Optimizing training performance with GPUs"
11711171
]
11721172
},
11731173
{
11741174
"cell_type": "markdown",
11751175
"id": "e68ae888-cabf-49c9-bad6-ecdce774db57",
11761176
"metadata": {},
11771177
"source": [
1178-
"### 2.9.1 PyTorch computations on GPU devices"
1178+
"### A.9.1 PyTorch computations on GPU devices"
11791179
]
11801180
},
11811181
{
11821182
"cell_type": "markdown",
11831183
"id": "141c845f-efe3-4614-b376-b8b7a9a2c887",
11841184
"metadata": {},
11851185
"source": [
1186-
"See [ch02-code-part2.ipynb](ch02-code-part2.ipynb)"
1186+
"See [code-part2.ipynb](code-part2.ipynb)"
11871187
]
11881188
},
11891189
{
11901190
"cell_type": "markdown",
11911191
"id": "99811829-b817-42ea-b03e-d35374debcc0",
11921192
"metadata": {},
11931193
"source": [
1194-
"### 2.9.2 Single-GPU training"
1194+
"### A.9.2 Single-GPU training"
11951195
]
11961196
},
11971197
{
11981198
"cell_type": "markdown",
11991199
"id": "0b21456c-4af7-440f-9e78-37770277b5bc",
12001200
"metadata": {},
12011201
"source": [
1202-
"See [ch02-code-part2.ipynb](ch02-code-part2.ipynb)"
1202+
"See [code-part2.ipynb](code-part2.ipynb)"
12031203
]
12041204
},
12051205
{
12061206
"cell_type": "markdown",
12071207
"id": "db6eb2d1-a341-4489-b04b-635c26945333",
12081208
"metadata": {},
12091209
"source": [
1210-
"### 2.9.3 Training with multiple GPUs"
1210+
"### A.9.3 Training with multiple GPUs"
12111211
]
12121212
},
12131213
{
12141214
"cell_type": "markdown",
12151215
"id": "9d049a81-5fb0-49b5-9d6a-17a9976d8520",
12161216
"metadata": {},
12171217
"source": [
1218-
"See [ch02-code-part3.py](ch02-code-part3.py)"
1218+
"See [code-part3.py](code-part3.py)"
12191219
]
12201220
}
12211221
],
@@ -1235,7 +1235,7 @@
12351235
"name": "python",
12361236
"nbconvert_exporter": "python",
12371237
"pygments_lexer": "ipython3",
1238-
"version": "3.10.12"
1238+
"version": "3.10.6"
12391239
}
12401240
},
12411241
"nbformat": 4,

ch02/03_main-chapter-code/ch02_code-part2.ipynb renamed to appendix-A/03_main-chapter-code/code-part2.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"id": "O9i6kzBsZVaZ"
77
},
88
"source": [
9-
"# Chapter 2: Introduction to PyTorch (Part 1)"
9+
"# Appendix A: Introduction to PyTorch (Part 2)"
1010
]
1111
},
1212
{
@@ -15,7 +15,7 @@
1515
"id": "ppbG5d-NZezH"
1616
},
1717
"source": [
18-
"## 2.9 Optimizing training performance with GPUs"
18+
"## A.9 Optimizing training performance with GPUs"
1919
]
2020
},
2121
{
@@ -24,7 +24,7 @@
2424
"id": "6jH0J_DPZhbn"
2525
},
2626
"source": [
27-
"### 2.9.1 PyTorch computations on GPU devices"
27+
"### A.9.1 PyTorch computations on GPU devices"
2828
]
2929
},
3030
{
@@ -165,7 +165,7 @@
165165
"id": "c8j1cWDcWAMf"
166166
},
167167
"source": [
168-
"## 2.9.2 Single-GPU training"
168+
"## A.9.2 Single-GPU training"
169169
]
170170
},
171171
{
@@ -444,7 +444,7 @@
444444
"name": "python",
445445
"nbconvert_exporter": "python",
446446
"pygments_lexer": "ipython3",
447-
"version": "3.10.12"
447+
"version": "3.10.6"
448448
}
449449
},
450450
"nbformat": 4,

0 commit comments

Comments
 (0)