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

Function accuracy

examples/hfl/src/client.py:138–143  ·  view source on GitHub ↗
(pred, target)

Source from the content-addressed store, hash-verified

136
137# Calculate accuracy
138def accuracy(pred, target):
139 # y is network output to be compared with ground truth (int)
140 y = np.argmax(pred, axis=1)
141 a = y == target
142 correct = np.array(a, "int").sum()
143 return correct
144
145
146# Data partition according to the rank

Callers 1

runFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected