You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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):
The text was updated successfully, but these errors were encountered: