Skip to content

Confusion in "mean_patch" pooling with ViT encoders #6

Description

@ashish-221b

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions