Skip to content

mismatched code and example image in beginner/blitz/neural_networks_tutorial.html #703

Closed
@csukuangfj

Description

@csukuangfj

This image at https://pytorch.org/tutorials/_images/mnist.png

shows that S4 is 16@5x5,

but the code

self.fc1 = nn.Linear(16 * 6 * 6, 120) # 6*6 from image dimension

says 16@6x6.

Since it is easier to change the code, the following lines

self.conv1 = nn.Conv2d(1, 6, 3)
self.conv2 = nn.Conv2d(6, 16, 3)
# an affine operation: y = Wx + b
self.fc1 = nn.Linear(16 * 6 * 6, 120) # 6*6 from image dimension

should be changed to

        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 * 5 * 5, 120)  # 5*5 from image dimension 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions