MCPcopy Index your code
hub / github.com/HobbitLong/PyContrast / update

Method update

pycontrast/learning/util.py:17–21  ·  view source on GitHub ↗
(self, val, n=1)

Source from the content-addressed store, hash-verified

15 self.count = 0
16
17 def update(self, val, n=1):
18 self.val = val
19 self.sum += val * n
20 self.count += n
21 self.avg = self.sum / self.count
22
23
24def accuracy(output, target, topk=(1,)):

Callers 4

_train_mocoMethod · 0.95
_train_memMethod · 0.95
trainMethod · 0.95
validateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected