Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
47
class
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
61
class
Timer():
Callers
8
__init__
Method · 0.90
__init__
Method · 0.90
base_train
Function · 0.85
test
Function · 0.85
test_withfc
Function · 0.85
test_intergrate
Method · 0.85
base_train
Function · 0.85
test
Function · 0.85
Calls
no outgoing calls
Tested by
2
test_withfc
Function · 0.68
test_intergrate
Method · 0.68