learnopencv
learnopencv copied to clipboard
Why is the kernel_size of the global average pooling layer 7x7 in fully convNet for image classification? How to decide it?
# resNet18 in pytorch use `AdaptiveAvgPool2d`, which collapses the feature maps
# of any size to the predefined one.
self.avgpool = nn.AvgPool2d((7,7)) # Replace AdaptiveAvgPool2d with standard AvgPool2d
I change it to 9x9, 11x11 or other values, the results seem similar.
What is the beset kernel_size given an input image wish shape 3xHxW