(self, val, n=1)
| 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 | |
| 93 | class EarlyStopping: |
| 94 | def __init__(self, patience: int = 10, min_delta: float = 0.0, mode: str = 'min'): |
nothing calls this directly
no outgoing calls
no test coverage detected