SimCLR icon indicating copy to clipboard operation
SimCLR copied to clipboard

Confusion matrix

Open here101 opened this issue 2 years ago • 0 comments

Does anyone know how to add the confusion matrix in this code? After I added it according to the online one, something went wrong. I don't know what went wrong in my code.I can't solve it. please help help me! Thanks. def confusion_matrix(output, labels, conf_matrix):

preds = torch.argmax(output, dim=-1)
for p, t in zip(preds, labels):
    conf_matrix[p, t] += 1
return conf_matrix

here101 avatar Mar 23 '22 07:03 here101