From 38f7a7b426d599ed82a04f09f29991cb75f7e9a4 Mon Sep 17 00:00:00 2001
From: Schneider Leo <leo.schneider@etu.ec-lyon.fr>
Date: Wed, 2 Apr 2025 11:22:35 +0200
Subject: [PATCH] fix : acc contrastive

---
 image_ref/main.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/image_ref/main.py b/image_ref/main.py
index 001af33..dc6b1f6 100644
--- a/image_ref/main.py
+++ b/image_ref/main.py
@@ -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()
-- 
GitLab