Metrics¶
Classification & Segmentation¶
Accuracy¶
-
common.utils.metric.
accuracy
(output, target, topk=(1, ))[source]¶ Computes the accuracy over the k top predictions for the specified values of k
- Parameters
output (tensor) – Classification outputs, \((N, C)\) where C = number of classes
target (tensor) – \((N)\) where each value is \(0 \leq \text{targets}[i] \leq C-1\)
topk (sequence[int]) – A list of top-N number.
- Returns
Top-N accuracies (N \(\in\) topK).