Skip to content

Commit 6308024

Browse files
WillRNaylorsoumith
authored andcommitted
change to 3x3 conv filters, for ease of reading dimension in net (#515)
1 parent 9480467 commit 6308024

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

beginner_source/blitz/neural_networks_tutorial.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ class Net(nn.Module):
4646

4747
def __init__(self):
4848
super(Net, self).__init__()
49-
# 1 input image channel, 6 output channels, 5x5 square convolution
49+
# 1 input image channel, 6 output channels, 3x3 square convolution
5050
# kernel
51-
self.conv1 = nn.Conv2d(1, 6, 5)
52-
self.conv2 = nn.Conv2d(6, 16, 5)
51+
self.conv1 = nn.Conv2d(1, 6, 3)
52+
self.conv2 = nn.Conv2d(6, 16, 3)
5353
# an affine operation: y = Wx + b
54-
self.fc1 = nn.Linear(16 * 5 * 5, 120)
54+
self.fc1 = nn.Linear(16 * 6 * 6, 120) # 6*6 from image dimension
5555
self.fc2 = nn.Linear(120, 84)
5656
self.fc3 = nn.Linear(84, 10)
5757

0 commit comments

Comments
 (0)