Skip to content

Commit 2885a30

Browse files
committed
Took the liberty to change the F1 metric dimension to fit
1 parent b9dc34e commit 2885a30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/metrics/F1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def forward(self, preds, target):
131131
torch.Tensor
132132
The computed F1 score (either micro or macro, based on `macro_averaging`).
133133
"""
134-
preds = torch.argmax(preds, dim=1)
134+
preds = torch.argmax(preds, dim=-1)
135135

136136
# Calculate True Positives (TP), False Positives (FP), and False Negatives (FN) per class
137137
for i in range(self.num_classes):

0 commit comments

Comments
 (0)