dicarlolab/CORnet

CORnet inconsistent vector length

heidamaria opened this issue · 1 comments

Disclaimer: I do not know whether this is an issue with CORnet or with the THINGSvision wrapper for CORnet (see: https://github.com/ViCCo-Group/THINGSvision).

When running images through CORnet-z, the output layer for IT, as far as I understand from the CORnet preprint, is supposed to be 7x7x512 which when flattened would be a vector of length 25088. This is indeed what happens when apply_center_crop is set to True. However, when it is set to False, the output vectors of the same images (224 x 224 pixels), same layer/module, end up being of size 32768. This behavior does not appear to be layer specific, I e.g. also tested it for the V1 output layer and the vector length also depends on whether center crop is applied or not.

I am not quite sure if this is a bug or "normal" behavior that I then just do not quite understand.

Hi @heidamaria,
I think this is normal behavior: when input images are larger, the convolutional kernels will be applied more times, leading to larger activation vectors. E.g. a kernel of size 7x7 and no strides across a 224x224 image will be applied 32 times per row and column, but 48 times if the image is 336x336