MCPcopy Create free account
hub / github.com/DingLei14/WiCoNet / binary_accuracy

Function binary_accuracy

utils/utils.py:178–183  ·  view source on GitHub ↗
(pred, label)

Source from the content-addressed store, hash-verified

176 return acc, valid_sum
177
178def binary_accuracy(pred, label):
179 valid = (label < 2)
180 acc_sum = (valid * (pred == label)).sum()
181 valid_sum = valid.sum()
182 acc = float(acc_sum) / (valid_sum + 1e-10)
183 return acc, valid_sum
184
185def intersectionAndUnion(imPred, imLab, numClass):
186 imPred = np.asarray(imPred).copy()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected