lucidrains / g-mlp-pytorch

Implementation of gMLP, an all-MLP replacement for Transformers, in Pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom image sizes?

danarte opened this issue · comments

Hi,
Thanks for your great (and very fast) contribution!
I was wondering if you could help me figure out how to apply this to a different image size?
It's not really an image, but rather a 2D dimensional tensor of 4096X100.

I saw that I can change the number of channels, so I could just set channels to be 1.
But I see that firstly - your implementation is for squared images, and secondly, it requires that image size should be devisable by patch size.

Since you've written this implementation perhaps you could help me to adapt it for my needs? (and maybe other users for their cases).

Maybe I could pad the length to be 128 so both would be devisable by 16 for example? but then where do I set different h, w ?

Thanks.

@danarte Hi! Do you want to let me know if 6549354 suits your needs?

I think padding and using the feature in my latest release will work well!

@lucidrains Thanks for the speedy update!
I'll check it in the next few days, but it already looks like it should work perfectly for my case.