MCPcopy
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
36def accuracy(output, target, topk=(1,)):

Callers 5

trainFunction · 0.95
validateFunction · 0.95
trainFunction · 0.95
trainFunction · 0.95
validateFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected