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

What is the difference between GVA and VA with shared plane? #40

Open
EricLina opened this issue May 5, 2023 · 1 comment
Open

What is the difference between GVA and VA with shared plane? #40

EricLina opened this issue May 5, 2023 · 1 comment

Comments

@EricLina
Copy link

EricLina commented May 5, 2023

GVA is proposed in PTV2 as a new method, but the implementation is equal as Vector Attention with shared plane in PTV1.

below are the comparisons:

PTV1:

    w = self.softmax(w)  # (n, nsample, c//s)
    n, nsample, c = x_v.shape; s = self.share_planes
    x = ((x_v + p_r).view(n, nsample, s, c // s) * w.unsqueeze(2)).sum(1).view(n, c)  # v * A

PTV2:

    value = einops.rearrange(value, "n ns (g i) -> n ns g i", g=self.groups)
    feat = torch.einsum("n s g i, n s g -> n g i", value, weight)
    feat = einops.rearrange(feat, "n g i -> n (g i)")

They are functionally equivalent!

I may also be wrong because I don't understand it well, can you explain the difference between them?

@leungMr
Copy link

leungMr commented Sep 21, 2023

I also have the same question, I don't understand the fundamental difference between these two... Do you understand now

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