Skip to content

difference between training and inference of omniaid #12

Description

@garychan22

I have noticed that there are some differences between the training and inference of omniaid.

During training, using

def forward(self, images) -> dict:
batch_size = images.size(0)
with torch.no_grad():
# Use the pooler_output as the routing feature
routing_features = self.feature_extractor(images, output_hidden_states=False).pooler_output
hidden_states = self.embeddings(images)
hidden_states = self.ln_pre(hidden_states)

During inference, using

def forward(self, images) -> dict:
batch_size = images.size(0)
hidden_states = self.embeddings(images)
routing_features = torch.mean(hidden_states[:, 1:, :], dim=1)

what is the reason for this? I want to implement the offline OmniAiD-DINO reward without GAN-style training.

Thanks~

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