MCPcopy Create free account
hub / github.com/LAMDA-CL/CVPR22-Fact / Averager

Class Averager

utils.py:47–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46
47class Averager():
48
49 def __init__(self):
50 self.n = 0
51 self.v = 0
52
53 def add(self, x):
54 self.v = (self.v * self.n + x) / (self.n + 1)
55 self.n += 1
56
57 def item(self):
58 return self.v
59
60
61class Timer():

Callers 8

__init__Method · 0.90
__init__Method · 0.90
base_trainFunction · 0.85
testFunction · 0.85
test_withfcFunction · 0.85
test_intergrateMethod · 0.85
base_trainFunction · 0.85
testFunction · 0.85

Calls

no outgoing calls

Tested by 2

test_withfcFunction · 0.68
test_intergrateMethod · 0.68