-
Hi there, Thank you for timm! It's been immensely helpful for my projects. I am currently working on training a model using the Mlp class from timm's repository, specifically the implementation found here: timm.layers.mlp.Mlp. I have some questions regarding the use_conv parameter:
Thanks for your time and assistance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Keep bugs / features in discussions please. If use_conv is True, yes it's expected that the input shape is NCHW. Does not matter what HW is. This mode is intended for places where you'd want an MLP in a predominantly convolutional or between convolutional / 2d spatial (avg pool, max pool) layers and you don't want to reshape/permute. If you have N?C then you use the default. I used it in ConvNeXt and MaxViT ( pytorch-image-models/timm/models/convnext.py Lines 130 to 164 in 3196d6b Theoretically there is no difference, practically the kernels used are a bit different so you may find one is faster than the other for certain shapes on certain hardware, etc. |
Beta Was this translation helpful? Give feedback.
Keep bugs / features in discussions please.
If use_conv is True, yes it's expected that the input shape is NCHW. Does not matter what HW is. This mode is intended for places where you'd want an MLP in a predominantly convolutional or between convolutional / 2d spatial (avg pool, max pool) layers and you don't want to reshape/permute. If you have N?C then you use the default. I used it in ConvNeXt and MaxViT (
pytorch-image-models/timm/models/convnext.py
Lines 130 to 164 in 3196d6b