Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/HobbitLong/SupContrast
/ update
Method
update
util.py:29–33 ·
view source on GitHub ↗
(self, val, n=1)
Source
from the content-addressed store, hash-verified
27
self.count = 0
28
29
def
update(self, val, n=1):
30
self.val = val
31
self.sum += val * n
32
self.count += n
33
self.avg = self.sum / self.count
34
35
36
def
accuracy(output, target, topk=(1,)):
Callers
5
train
Function · 0.95
validate
Function · 0.95
train
Function · 0.95
train
Function · 0.95
validate
Function · 0.95
Calls
no outgoing calls
Tested by
no test coverage detected