MCPcopy Create free account
hub / github.com/coperception/star / __init__

Method __init__

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

Source from the content-addressed store, hash-verified

27 """
28
29 def __init__(self, window_size=20, fmt=None):
30 if fmt is None:
31 fmt = "{median:.4f} ({global_avg:.4f})"
32 self.deque = deque(maxlen=window_size)
33 self.total = 0.0
34 self.count = 0
35 self.fmt = fmt
36
37 def update(self, value, n=1):
38 self.deque.append(value)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected