MCPcopy Create free account
hub / github.com/OUCMachineLearning/OUCML / compute_acc

Function compute_acc

GAN/ACGAN-PyTorch-master/utils.py:11–16  ·  view source on GitHub ↗
(preds, labels)

Source from the content-addressed store, hash-verified

9
10# compute the current classification accuracy
11def compute_acc(preds, labels):
12 correct = 0
13 preds_ = preds.data.max(1)[1]
14 correct = preds_.eq(labels.data).cpu().sum()
15 acc = float(correct) / float(len(labels.data)) * 100.0
16 return acc

Callers 1

main.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected