Skip to content

Instantly share code, notes, and snippets.

@williamFalcon
Last active June 19, 2020 22:15
Show Gist options
  • Save williamFalcon/111862017e7ad3ea55d8604cb6eadf4c to your computer and use it in GitHub Desktop.
Save williamFalcon/111862017e7ad3ea55d8604cb6eadf4c to your computer and use it in GitHub Desktop.
import pytorch_lightning.metrics.functional as plm
pred = torch.tensor([0, 1, 2, 3])
target = torch.tensor([0, 1, 2, 2])
# many popular classification metrics and more
plm.accuracy(pred, target)
plm.auc(pred, target)
plm.auroc(pred, target)
plm.average_precision(pred, target)
plm.confusion_matrix(pred, target)
plm.dice_score(pred, target)
plm.f1_score(pred, target)
...
# 20+ metrics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment