pytorch-cifar icon indicating copy to clipboard operation
pytorch-cifar copied to clipboard

The biggest issue!

Open morawi opened this issue 4 years ago • 2 comments

It is mentioned in the forward function of mobilenet_v2 that "NOTE: change pooling kernel_size 7 -> 4 for CIFAR10". How about other changes to other models?

Does this mean that the models in this repo are vulnerable and may not work well with other problems / datasets?

Thanks in advance!

morawi avatar Sep 09 '19 15:09 morawi

I think there are several minor changes made compared with the original papers (at least ResNet-18). However, these changes should not affect the performance much. It is just not convenient when you need to make fair comparisons with the original papers.

ZHUANGHP avatar Sep 11 '19 02:09 ZHUANGHP

I think the purpose of this change is to let those models be suitable for CIFAR10. Pictures in CIFAR10 has a size of 3232 rather than 256256, so it's not suitable to use the same preprocessing method like other big datasets such as ImageNet, which is to resize pictures to 224224. The author resizes pictures to 3232 via padding=4, which to the greatest extent maintains the original quality of those small-size data. So if data's size is smaller and we want to maintain the number of layers in the net to be same to have the same network complexity and performance, we have to change the kernel size of some layers in every single net, including changing the first conv layer's kernel size 7->4 and the last pooling layer's kernel size 8->4, etc. You could do some calculations on paper and I believe you'll figure it out. If you want to build a 'robust' model which is suitable for all datasets, you could simply resize the image size to 224*224 and use a same kernel size setting for all datasets, but this maybe influence your network's performance

JustinYuu avatar Feb 12 '20 06:02 JustinYuu