MCPcopy Create free account
hub / github.com/bic-L/MaxFormer / __init__

Method __init__

event/utils.py:16–22  ·  view source on GitHub ↗
(self, window_size=20, fmt=None)

Source from the content-addressed store, hash-verified

14 """
15
16 def __init__(self, window_size=20, fmt=None):
17 if fmt is None:
18 fmt = "{median:.4f} ({global_avg:.4f})"
19 self.deque = deque(maxlen=window_size)
20 self.total = 0.0
21 self.count = 0
22 self.fmt = fmt
23
24 def update(self, value, n=1):
25 self.deque.append(value)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected