MCPcopy Create free account
hub / github.com/lingeringlight/START / __init__

Method __init__

utils.py:23–29  ·  view source on GitHub ↗
(self, window_size=20, fmt=None)

Source from the content-addressed store, hash-verified

21 """
22
23 def __init__(self, window_size=20, fmt=None):
24 if fmt is None:
25 fmt = "{median:.4f} ({global_avg:.4f})"
26 self.deque = deque(maxlen=window_size)
27 self.total = 0.0
28 self.count = 0
29 self.fmt = fmt
30
31 def update(self, value, n=1):
32 self.deque.append(value)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected