Skip to content
Snippets Groups Projects
Commit 38f7a7b4 authored by Schneider Leo's avatar Schneider Leo
Browse files

fix : acc contrastive

parent 0ebf7166
No related branches found
No related tags found
No related merge requests found
......@@ -61,7 +61,7 @@ def test_duo(model, data_test, loss_function, epoch):
label_class = torch.argmin(label).data.cpu().numpy()
pred_logits = model.forward(imaer,imana,img_ref)
pred_class = torch.argmax(pred_logits[:,0])
acc_contrastive += (torch.argmax(pred_logits,dim=1).data.cpu().numpy()==label).sum().item()
acc_contrastive += (torch.argmax(pred_logits,dim=1).data.cpu().numpy()==label.data.cpu().numpy()).sum().item()
acc += (pred_class==label_class)
loss = loss_function(pred_logits,label)
losses += loss.item()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment