adding pos and neg losses

This commit is contained in:
Alejandro Moreo Fernandez 2021-02-04 18:52:46 +01:00
parent 1385d2ac95
commit 38867371fa
1 changed files with 1 additions and 1 deletions

View File

@ -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)