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

Function accuracy

examples/cnn/train_cnn.py:49–54  ·  view source on GitHub ↗
(pred, target)

Source from the content-addressed store, hash-verified

47
48# Calculate accuracy
49def accuracy(pred, target):
50 # y is network output to be compared with ground truth (int)
51 y = np.argmax(pred, axis=1)
52 a = y == target
53 correct = np.array(a, "int").sum()
54 return correct
55
56
57# Data partition according to the rank

Callers 1

runFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected