MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / __call__

Method __call__

pager_lib/tqdm/std.py:230–241  ·  view source on GitHub ↗

Parameters ---------- x : float New value to include in EMA.

(self, x=None)

Source from the content-addressed store, hash-verified

228 self.calls = 0
229
230 def __call__(self, x=None):
231 """
232 Parameters
233 ----------
234 x : float
235 New value to include in EMA.
236 """
237 beta = 1 - self.alpha
238 if x is not None:
239 self.last = self.alpha * x + beta * self.last
240 self.calls += 1
241 return self.last / (1 - beta ** self.calls) if self.calls else self.last
242
243
244class tqdm(Comparable):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected