I am trying to create a convolutional network for image classification problem. I am using PyTorch but I have troubles in understending the implementation of their 2D convolutional layer. I understand that in my case there are going to be 3 input channels (RGB) but what about the output ones? How do I know how many of them are supposed to be there? Is there any corelation with the output number and input number or the filter kernel size?
Also I found a code where the convolution is implemented with following parameters and a comment:
nn.Conv2d(3, 20, (5,5))
# img 3 * 32 * 32 -> img 20 * 28 * 28
Is there any reason they chose 20? What's with the 28? I don't get how they came up with this number.
Another problem is with other hyperparameters like stride or padding. Is there any way or maybe some best practices to choose these parameters "correctly"?
Some help would be very appreciated.