Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the Patch Splitting Image. #82

Closed
GajuuzZ opened this issue Jul 16, 2022 · 3 comments
Closed

About the Patch Splitting Image. #82

GajuuzZ opened this issue Jul 16, 2022 · 3 comments

Comments

@GajuuzZ
Copy link

GajuuzZ commented Jul 16, 2022

Can you explain more about using Conv2d as a patch-splitting image? (in the Discriminator) Since the image will change when applying the Conv and it didn't split the image into parts of a grid as the Vision-Transformer do. And I saw some other implement uses Unfold to split the image.

        self.fRGB_1 = nn.Conv2d(3, embed_dim//4, kernel_size=6, stride=4, padding=1)
        self.fRGB_2 = nn.Conv2d(3, embed_dim//4, kernel_size=10, stride=8, padding=1)
        self.fRGB_3 = nn.Conv2d(3, embed_dim//2, kernel_size=18, stride=16, padding=1)
@yifanjiang19
Copy link
Contributor

yifanjiang19 commented Jul 21, 2022

My original implementation uses the same kernel_size and stride while in that case this is equal to splitting. But later I found that overlapped splitting gets slightly better performance and I changed to this version. But you can still change it back to non-overlapped version and that will give you reasonable results as well.

@GajuuzZ
Copy link
Author

GajuuzZ commented Jul 22, 2022

I don't understand how convolution will split the image? since it convolves the whole image and gets the new one for each channel.
And yes, when plotting it didn't seem to have a reasonable result.

@yifanjiang19
Copy link
Contributor

Convolution is not equal to splitting but equals to splitting + additional MLP layers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants