Skip to content

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

@EricLina

Description

@EricLina

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions