Skip to content

Commit

Permalink
from @or-toledano: Reduce half of similarity muls after encoding (ope…
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Sepiol authored and rom1504 committed Sep 26, 2022
1 parent e76d431 commit 61cd490
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clip/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def forward(self, image, text):
# cosine similarity as logits
logit_scale = self.logit_scale.exp()
logits_per_image = logit_scale * image_features @ text_features.t()
logits_per_text = logit_scale * text_features @ image_features.t()
logits_per_text = logits_per_image.t()

# shape = [global_batch_size, global_batch_size]
return logits_per_image, logits_per_text
Expand Down

0 comments on commit 61cd490

Please sign in to comment.