Hi,
I was trying to follow this tutorial 415. But I’m not fully understanding the following section of the code. The code used mnist data, of size 28 x 28 x 1 & 10 classes.
self.conv = torch.nn.Sequential()
        self.conv.add_module("conv_1", torch.nn.Conv2d(1, 10, kernel_size=5))
        self.conv.add_module("maxpool_1", torch.nn.MaxPool2d(kernel_size=2))
        self.conv.add_module("relu_1", torch.nn.ReLU())
        self.conv.add_module("conv_2", torch.nn.Conv2d(10, 20, kernel_size=5))
        self.conv.add_module("dropout_2", torch.nn.Dropout())
        self.conv.add_module("maxpool_2", torch.nn.MaxPool2d(kernel_size=2))
        self.conv.add_module("relu_2", torch.nn.ReLU())

        self.fc = torch.nn.Sequential()
        self.fc.add_module("fc1", torch.nn.Linear(320, 50))
        self.fc.add_module("relu_3", torch.nn.ReLU())
        self.fc.add_module("dropout_3", torch.nn.Dropout())
        self.fc.add_module("fc2", torch.nn.Linear(50, output_dim))

In the code, we are having 2 convolution layer followed by 1 fully connected layer. After each convolution layer we have 1 max pooling and 1 ‘relu’.
But my questions are the following:

Why we are having 10 in first convolution layer? Generally output of first conv layer is given by (W−F+2P)/S+1.
In second conv layer we have output as 20? Again why we are using it.
In the fully connected layer, we have 320 & 50 as input and output respectively. From where we are getting these values.

I’m completely new to pytorch. So having difficulty in understanding simple things. The documentations are always not very clear.
If someone can answer these questions, then it will be very helpful.
Thank you!