MCPcopy Create free account
hub / github.com/apache/singa / accuracy

Function accuracy

examples/onnx/training/train.py:57–63  ·  view source on GitHub ↗
(pred, target)

Source from the content-addressed store, hash-verified

55
56# Calculate Accuracy
57def accuracy(pred, target):
58 # y is network output to be compared with ground truth (int)
59 y = np.argmax(pred, axis=1)
60 a = y == target
61 correct = np.array(a, "int").sum()
62 # print(correct)
63 return correct
64
65
66# Data partition according to the rank

Callers 1

runFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected