Skip to content

Commit

Permalink
Fix guiding mask by adding offset
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonCakes committed Apr 15, 2024
1 parent 3208e61 commit 3215c06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sentence_transformers/losses/CachedGISTEmbedLoss.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def calculate_loss_and_cache_gradients(self, reps: List[List[Tensor]], reps_guid
guided_aa_sim = self.sim_matrix(anchor_guide[b:e], anchor_guide)
guided_pp_sim = self.sim_matrix(positive_guide[b:e], positive_guide)
# Define the anchor threshold
guided_sim = guided_ap_sim.diagonal().view(-1, 1)
guided_sim = guided_ap_sim.diagonal(offset=b).view(-1, 1)

# Compute similarity scores for current mini-batch.
# anchor (mbsz,hdim), positive (bsz,hdim)
Expand Down

0 comments on commit 3215c06

Please sign in to comment.