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

Problem regarding PEG #37

Open
Haus226 opened this issue Oct 8, 2024 · 0 comments
Open

Problem regarding PEG #37

Haus226 opened this issue Oct 8, 2024 · 0 comments

Comments

@Haus226
Copy link

Haus226 commented Oct 8, 2024

In the init function of the PEG class, it seems that the groups parameter should be set to in_chans rather than embed_dim, since this is intended to be a depthwise convolution. Although in the current use cases in the file, in_chans and embed_dim are equal, updating this would make the code clearer and more explicit.

# PEG  from https://arxiv.org/abs/2102.10882
class PosCNN(nn.Module):
    def __init__(self, in_chans, embed_dim=768, s=1):
        super(PosCNN, self).__init__()
        self.proj = nn.Sequential(nn.Conv2d(in_chans, embed_dim, 3, s, 1, bias=True, groups=embed_dim), )
        self.s = s
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

1 participant