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

Confusion in "mean_patch" pooling with ViT encoders #6

Open
ashish-221b opened this issue May 3, 2023 · 0 comments
Open

Confusion in "mean_patch" pooling with ViT encoders #6

ashish-221b opened this issue May 3, 2023 · 0 comments

Comments

@ashish-221b
Copy link

In vit.py in forward_set function

the transform module is being used twice in 1 forward evaluation.

First the common forward

x = self.dropout(x)
x_set = self.transformer(x)

Second during mean_patch pooling

elif self.pool == "mean_patch":
x = x_set[:, self.k:]
# attention here what you average
x = x.view(b, np//ns, ns, -1)
x = x.mean(dim = 2)
x = self.transformer(x)

Is this intended?

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