(predictions, targets)
| 154 | return self.matrix |
| 155 | |
| 156 | def accuracy(predictions, targets): |
| 157 | correct = (predictions == targets).sum() |
| 158 | total = len(targets) |
| 159 | return 100.0 * correct / total if total > 0 else 0.0 |
| 160 | |
| 161 | def top_k_accuracy(output, target, k=5): |
| 162 | with torch.no_grad(): |
nothing calls this directly
no outgoing calls
no test coverage detected