MCPcopy Create free account
hub / github.com/geekcomputers/Python / update

Method update

ML/src/python/neuralforge/utils/metrics.py:87–91  ·  view source on GitHub ↗
(self, val, n=1)

Source from the content-addressed store, hash-verified

85 self.count = 0
86
87 def update(self, val, n=1):
88 self.val = val
89 self.sum += val * n
90 self.count += n
91 self.avg = self.sum / self.count if self.count > 0 else 0
92
93class EarlyStopping:
94 def __init__(self, patience: int = 10, min_delta: float = 0.0, mode: str = 'min'):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected