From 6175ae13b915a23caec3b8896290d0069996cbdc Mon Sep 17 00:00:00 2001 From: Kyungwon Chun Date: Tue, 30 Mar 2021 16:02:58 +0900 Subject: [PATCH 1/3] Fix a typo in inline HTML. Unnecessary comma prevents image display. --- Part 7 - Loading Image Data.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Part 7 - Loading Image Data.ipynb b/Part 7 - Loading Image Data.ipynb index 9fe51b4a..a183c40b 100644 --- a/Part 7 - Loading Image Data.ipynb +++ b/Part 7 - Loading Image Data.ipynb @@ -120,7 +120,7 @@ "source": [ "If you loaded the data correctly, you should see something like this (your image will be different):\n", "\n", - "" + "" ] }, { @@ -239,7 +239,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.4" + "version": "3.8.8" } }, "nbformat": 4, From 19536e7770523e1dee23256ab09d0245859ce330 Mon Sep 17 00:00:00 2001 From: Kyungwon Chun Date: Tue, 30 Mar 2021 16:36:35 +0900 Subject: [PATCH 2/3] Fix Normalize parameters MNIST data has only one color channel, but the parameters of Normalize are for three color channels. --- Part 2 - Neural Networks in PyTorch.ipynb | 2 +- Part 3 - Training Neural Networks.ipynb | 2 +- Part 4 - Fashion-MNIST Exercise.ipynb | 2 +- Part 5 - Inference and Validation.ipynb | 2 +- Part 6 - Saving and Loading Models.ipynb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Part 2 - Neural Networks in PyTorch.ipynb b/Part 2 - Neural Networks in PyTorch.ipynb index 6d139c0f..b108f606 100644 --- a/Part 2 - Neural Networks in PyTorch.ipynb +++ b/Part 2 - Neural Networks in PyTorch.ipynb @@ -44,7 +44,7 @@ "source": [ "# Define a transform to normalize the data\n", "transform = transforms.Compose([transforms.ToTensor(),\n", - " transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),\n", + " transforms.Normalize((0.5,), (0.5,)),\n", " ])\n", "# Download and load the training data\n", "trainset = datasets.MNIST('MNIST_data/', download=True, train=True, transform=transform)\n", diff --git a/Part 3 - Training Neural Networks.ipynb b/Part 3 - Training Neural Networks.ipynb index 190a8cc8..0f24d600 100644 --- a/Part 3 - Training Neural Networks.ipynb +++ b/Part 3 - Training Neural Networks.ipynb @@ -218,7 +218,7 @@ "\n", "# Define a transform to normalize the data\n", "transform = transforms.Compose([transforms.ToTensor(),\n", - " transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),\n", + " transforms.Normalize((0.5,), (0.5,)),\n", " ])\n", "# Download and load the training data\n", "trainset = datasets.MNIST('MNIST_data/', download=True, train=True, transform=transform)\n", diff --git a/Part 4 - Fashion-MNIST Exercise.ipynb b/Part 4 - Fashion-MNIST Exercise.ipynb index 2928d9b3..77a3a7c7 100644 --- a/Part 4 - Fashion-MNIST Exercise.ipynb +++ b/Part 4 - Fashion-MNIST Exercise.ipynb @@ -27,7 +27,7 @@ "\n", "# Define a transform to normalize the data\n", "transform = transforms.Compose([transforms.ToTensor(),\n", - " transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])\n", + " transforms.Normalize((0.5,), (0.5,))])\n", "# Download and load the training data\n", "trainset = datasets.FashionMNIST('F_MNIST_data/', download=True, train=True, transform=transform)\n", "trainloader = torch.utils.data.DataLoader(trainset, batch_size=64, shuffle=True)\n", diff --git a/Part 5 - Inference and Validation.ipynb b/Part 5 - Inference and Validation.ipynb index b5479d9f..fb2768cb 100644 --- a/Part 5 - Inference and Validation.ipynb +++ b/Part 5 - Inference and Validation.ipynb @@ -43,7 +43,7 @@ "source": [ "# Define a transform to normalize the data\n", "transform = transforms.Compose([transforms.ToTensor(),\n", - " transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])\n", + " transforms.Normalize((0.5,), (0.5,))])\n", "# Download and load the training data\n", "trainset = datasets.FashionMNIST('F_MNIST_data/', download=True, train=True, transform=transform)\n", "trainloader = torch.utils.data.DataLoader(trainset, batch_size=64, shuffle=True)\n", diff --git a/Part 6 - Saving and Loading Models.ipynb b/Part 6 - Saving and Loading Models.ipynb index 293ae1cc..c0105a6a 100644 --- a/Part 6 - Saving and Loading Models.ipynb +++ b/Part 6 - Saving and Loading Models.ipynb @@ -38,7 +38,7 @@ "source": [ "# Define a transform to normalize the data\n", "transform = transforms.Compose([transforms.ToTensor(),\n", - " transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])\n", + " transforms.Normalize((0.5,), (0.5,))])\n", "# Download and load the training data\n", "trainset = datasets.FashionMNIST('F_MNIST_data/', download=True, train=True, transform=transform)\n", "trainloader = torch.utils.data.DataLoader(trainset, batch_size=64, shuffle=True)\n", From 06b5ebeed2bac6e1b711cc613d5ee09cf372bd1e Mon Sep 17 00:00:00 2001 From: Kyungwon Chun Date: Tue, 30 Mar 2021 21:26:58 +0900 Subject: [PATCH 3/3] Revert Python version --- Part 7 - Loading Image Data.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Part 7 - Loading Image Data.ipynb b/Part 7 - Loading Image Data.ipynb index a183c40b..365d3859 100644 --- a/Part 7 - Loading Image Data.ipynb +++ b/Part 7 - Loading Image Data.ipynb @@ -239,7 +239,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.8" + "version": "3.6.4" } }, "nbformat": 4,