adding pos and neg losses
This commit is contained in:
parent
1385d2ac95
commit
38867371fa
|
@ -177,7 +177,7 @@ class AuthorshipAttributionClassifier(nn.Module):
|
|||
phi = self.projector(xi)
|
||||
contrastive_loss, neg_loss, pos_loss = criterion(phi, torch.as_tensor(yi).to(self.device))
|
||||
#contrastive_loss = neg_loss + pos_loss
|
||||
losses.append(contrastive_loss.item())
|
||||
losses.append((neg_loss + pos_loss).item())
|
||||
neg_losses_val.append(neg_loss.item())
|
||||
pos_losses_val.append(pos_loss.item())
|
||||
val_loss = np.mean(losses)
|
||||
|
|
Loading…
Reference in New Issue