MCPcopy Create free account
hub / github.com/chengsen/PyTorch_TextGCN / accuracy

Function accuracy

utils.py:43–47  ·  view source on GitHub ↗
(pred, targ)

Source from the content-addressed store, hash-verified

41
42
43def accuracy(pred, targ):
44 pred = th.max(pred, 1)[1]
45 acc = ((pred == targ).float()).sum().item() / targ.size()[0]
46
47 return acc
48
49
50class CudaUse(object):

Callers 1

valMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected