Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
43
def
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
50
class
CudaUse(object):
Callers
1
val
Method · 0.90
Calls
no outgoing calls
Tested by
no test coverage detected