Skip to content

Commit

Permalink
subsample
Browse files Browse the repository at this point in the history
  • Loading branch information
alicebizeul committed Apr 16, 2023
1 parent 8023ce9 commit 4d6198f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion simclr/modules/custom_infonce.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def forward(self, anchor_rec, positive_rec):
# total_loss_value = torch.mean(- pos + neg)
if self.bound:
if self.subsample:
keep=random.shuffle(list(np.arange(anchor_rec.shape[1])))
keep=random.shuffle(list(np.arange(anchor_rec.shape[1])))[:int(int(anchor_rec.shape[1])/2)]
sim11=sim11[:,keep,:]
sim12=sim12[:,keep,:]
sim22=sim22[:,keep,:]
Expand Down

0 comments on commit 4d6198f

Please sign in to comment.