From 59209c6fafd315cd85a72607d862bd606d768d9c Mon Sep 17 00:00:00 2001 From: Steven Basart Date: Sat, 23 May 2020 21:31:53 -0400 Subject: [PATCH 1/2] Change kernel filters to reflect image and Colab The kernel filters should be 5x5 as opposed to 3x3 as that is what is depicted in the image and what it done within the Google Colab. --- beginner_source/blitz/neural_networks_tutorial.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/beginner_source/blitz/neural_networks_tutorial.py b/beginner_source/blitz/neural_networks_tutorial.py index 144dd3d144f..e981f935a90 100644 --- a/beginner_source/blitz/neural_networks_tutorial.py +++ b/beginner_source/blitz/neural_networks_tutorial.py @@ -46,10 +46,10 @@ class Net(nn.Module): def __init__(self): super(Net, self).__init__() - # 1 input image channel, 6 output channels, 3x3 square convolution + # 1 input image channel, 6 output channels, 5x5 square convolution # kernel - self.conv1 = nn.Conv2d(1, 6, 3) - self.conv2 = nn.Conv2d(6, 16, 3) + self.conv1 = nn.Conv2d(1, 6, 5) + self.conv2 = nn.Conv2d(6, 16, 5) # an affine operation: y = Wx + b self.fc1 = nn.Linear(16 * 6 * 6, 120) # 6*6 from image dimension self.fc2 = nn.Linear(120, 84) From 1fdccc98b19833ed76aba0f8913d1d6cb1a84a37 Mon Sep 17 00:00:00 2001 From: Steven Basart Date: Sat, 25 Jul 2020 12:23:04 -0400 Subject: [PATCH 2/2] 16x5x5 matches the image at the top of the page --- beginner_source/blitz/neural_networks_tutorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beginner_source/blitz/neural_networks_tutorial.py b/beginner_source/blitz/neural_networks_tutorial.py index e981f935a90..468dc043ec0 100644 --- a/beginner_source/blitz/neural_networks_tutorial.py +++ b/beginner_source/blitz/neural_networks_tutorial.py @@ -51,7 +51,7 @@ def __init__(self): self.conv1 = nn.Conv2d(1, 6, 5) self.conv2 = nn.Conv2d(6, 16, 5) # an affine operation: y = Wx + b - self.fc1 = nn.Linear(16 * 6 * 6, 120) # 6*6 from image dimension + self.fc1 = nn.Linear(16 * 5 * 5, 120) # 5*5 from image dimension self.fc2 = nn.Linear(120, 84) self.fc3 = nn.Linear(84, 10)