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

Function accuracy

examples/malaria_cnn/train_cnn.py:50–55  ·  view source on GitHub ↗
(pred, target)

Source from the content-addressed store, hash-verified

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

Callers 1

runFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected