restruture old ch02 into appendix A

This commit is contained in:
rasbt 2023-09-22 07:01:08 -05:00
parent d66b23588d
commit 5723c3802b
19 changed files with 27 additions and 25 deletions

View File

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 180 KiB

View File

Before

Width:  |  Height:  |  Size: 220 KiB

After

Width:  |  Height:  |  Size: 220 KiB

View File

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 186 KiB

View File

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 174 KiB

View File

Before

Width:  |  Height:  |  Size: 185 KiB

After

Width:  |  Height:  |  Size: 185 KiB

View File

Before

Width:  |  Height:  |  Size: 758 KiB

After

Width:  |  Height:  |  Size: 758 KiB

View File

Before

Width:  |  Height:  |  Size: 203 KiB

After

Width:  |  Height:  |  Size: 203 KiB

View File

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 204 KiB

View File

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

@ -1,3 +1,5 @@
# Appendix A: Introduction to PyTorch (Part 3)
import torch import torch
import torch.nn.functional as F import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader from torch.utils.data import Dataset, DataLoader

View File

@ -5,7 +5,7 @@
"id": "ca7fc8a0-280c-4979-b0c7-fc3a99b3b785", "id": "ca7fc8a0-280c-4979-b0c7-fc3a99b3b785",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# Chapter 2: Introduction to PyTorch (Part 1)" "# Appendix A: Introduction to PyTorch (Part 1)"
] ]
}, },
{ {
@ -13,7 +13,7 @@
"id": "f5bf13d2-8fc2-483e-88cc-6b4310221e68", "id": "f5bf13d2-8fc2-483e-88cc-6b4310221e68",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## 2.1 What is PyTorch" "## A.1 What is PyTorch"
] ]
}, },
{ {
@ -59,7 +59,7 @@
"id": "2100cf2e-7459-4ab3-92a8-43e86ab35a9b", "id": "2100cf2e-7459-4ab3-92a8-43e86ab35a9b",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## 2.2 Understanding tensors" "## A.2 Understanding tensors"
] ]
}, },
{ {
@ -67,7 +67,7 @@
"id": "26d7f785-e048-42bc-9182-a556af6bb7f4", "id": "26d7f785-e048-42bc-9182-a556af6bb7f4",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### 2.2.1 Scalars, vectors, matrices, and tensors" "### A.2.1 Scalars, vectors, matrices, and tensors"
] ]
}, },
{ {
@ -148,7 +148,7 @@
"id": "63dec48d-2b60-41a2-ac06-fef7e718605a", "id": "63dec48d-2b60-41a2-ac06-fef7e718605a",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### 2.2.2 Tensor data types" "### A.2.2 Tensor data types"
] ]
}, },
{ {
@ -213,7 +213,7 @@
"id": "2020deb5-aa02-4524-b311-c010f4ad27ff", "id": "2020deb5-aa02-4524-b311-c010f4ad27ff",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### 2.2.3 Common PyTorch tensor operations" "### A.2.3 Common PyTorch tensor operations"
] ]
}, },
{ {
@ -378,7 +378,7 @@
"id": "4c15bdeb-78e2-4870-8a4f-a9f591666f38", "id": "4c15bdeb-78e2-4870-8a4f-a9f591666f38",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## 2.3 Seeing models as computation graphs" "## A.3 Seeing models as computation graphs"
] ]
}, },
{ {
@ -415,7 +415,7 @@
"id": "f9424f26-2bac-47e7-b834-92ece802247c", "id": "f9424f26-2bac-47e7-b834-92ece802247c",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## 2.4 Automatic differentiation made easy" "## A.4 Automatic differentiation made easy"
] ]
}, },
{ {
@ -481,7 +481,7 @@
"id": "f53bdd7d-44e6-40ab-8a5a-4eef74ef35dc", "id": "f53bdd7d-44e6-40ab-8a5a-4eef74ef35dc",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## 2.5 Implementing multilayer neural networks" "## A.5 Implementing multilayer neural networks"
] ]
}, },
{ {
@ -709,7 +709,7 @@
"id": "19858180-0f26-43a8-b2c3-7ed40abf9f85", "id": "19858180-0f26-43a8-b2c3-7ed40abf9f85",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## 2.6 Setting up efficient data loaders" "## A.6 Setting up efficient data loaders"
] ]
}, },
{ {
@ -884,7 +884,7 @@
"id": "d904ca82-e50f-4f3d-a3ac-fc6ca53dd00e", "id": "d904ca82-e50f-4f3d-a3ac-fc6ca53dd00e",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## 2.7 A typical training loop" "## A.7 A typical training loop"
] ]
}, },
{ {
@ -1127,7 +1127,7 @@
"id": "4d5cd469-3a45-4394-944b-3ce543f41dac", "id": "4d5cd469-3a45-4394-944b-3ce543f41dac",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## 2.8 Saving and loading models" "## A.8 Saving and loading models"
] ]
}, },
{ {
@ -1167,7 +1167,7 @@
"id": "f891c013-43da-4a05-973d-997be313d2d8", "id": "f891c013-43da-4a05-973d-997be313d2d8",
"metadata": {}, "metadata": {},
"source": [ "source": [
"## 2.9 Optimizing training performance with GPUs" "## A.9 Optimizing training performance with GPUs"
] ]
}, },
{ {
@ -1175,7 +1175,7 @@
"id": "e68ae888-cabf-49c9-bad6-ecdce774db57", "id": "e68ae888-cabf-49c9-bad6-ecdce774db57",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### 2.9.1 PyTorch computations on GPU devices" "### A.9.1 PyTorch computations on GPU devices"
] ]
}, },
{ {
@ -1183,7 +1183,7 @@
"id": "141c845f-efe3-4614-b376-b8b7a9a2c887", "id": "141c845f-efe3-4614-b376-b8b7a9a2c887",
"metadata": {}, "metadata": {},
"source": [ "source": [
"See [ch02-code-part2.ipynb](ch02-code-part2.ipynb)" "See [code-part2.ipynb](code-part2.ipynb)"
] ]
}, },
{ {
@ -1191,7 +1191,7 @@
"id": "99811829-b817-42ea-b03e-d35374debcc0", "id": "99811829-b817-42ea-b03e-d35374debcc0",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### 2.9.2 Single-GPU training" "### A.9.2 Single-GPU training"
] ]
}, },
{ {
@ -1199,7 +1199,7 @@
"id": "0b21456c-4af7-440f-9e78-37770277b5bc", "id": "0b21456c-4af7-440f-9e78-37770277b5bc",
"metadata": {}, "metadata": {},
"source": [ "source": [
"See [ch02-code-part2.ipynb](ch02-code-part2.ipynb)" "See [code-part2.ipynb](code-part2.ipynb)"
] ]
}, },
{ {
@ -1207,7 +1207,7 @@
"id": "db6eb2d1-a341-4489-b04b-635c26945333", "id": "db6eb2d1-a341-4489-b04b-635c26945333",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### 2.9.3 Training with multiple GPUs" "### A.9.3 Training with multiple GPUs"
] ]
}, },
{ {
@ -1215,7 +1215,7 @@
"id": "9d049a81-5fb0-49b5-9d6a-17a9976d8520", "id": "9d049a81-5fb0-49b5-9d6a-17a9976d8520",
"metadata": {}, "metadata": {},
"source": [ "source": [
"See [ch02-code-part3.py](ch02-code-part3.py)" "See [code-part3.py](code-part3.py)"
] ]
} }
], ],
@ -1235,7 +1235,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.12" "version": "3.10.6"
} }
}, },
"nbformat": 4, "nbformat": 4,

View File

@ -6,7 +6,7 @@
"id": "O9i6kzBsZVaZ" "id": "O9i6kzBsZVaZ"
}, },
"source": [ "source": [
"# Chapter 2: Introduction to PyTorch (Part 1)" "# Appendix A: Introduction to PyTorch (Part 2)"
] ]
}, },
{ {
@ -15,7 +15,7 @@
"id": "ppbG5d-NZezH" "id": "ppbG5d-NZezH"
}, },
"source": [ "source": [
"## 2.9 Optimizing training performance with GPUs" "## A.9 Optimizing training performance with GPUs"
] ]
}, },
{ {
@ -24,7 +24,7 @@
"id": "6jH0J_DPZhbn" "id": "6jH0J_DPZhbn"
}, },
"source": [ "source": [
"### 2.9.1 PyTorch computations on GPU devices" "### A.9.1 PyTorch computations on GPU devices"
] ]
}, },
{ {
@ -165,7 +165,7 @@
"id": "c8j1cWDcWAMf" "id": "c8j1cWDcWAMf"
}, },
"source": [ "source": [
"## 2.9.2 Single-GPU training" "## A.9.2 Single-GPU training"
] ]
}, },
{ {
@ -444,7 +444,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.12" "version": "3.10.6"
} }
}, },
"nbformat": 4, "nbformat": 4,