MCPcopy
hub / github.com/facebookresearch/vggt / update

Method update

training/train_utils/general.py:273–280  ·  view source on GitHub ↗
(self, val, n=1)

Source from the content-addressed store, hash-verified

271 self._allow_updates = True
272
273 def update(self, val, n=1):
274 if n <= 0:
275 raise ValueError(f"n must be positive, got {n}")
276
277 self.val = val
278 self.sum += val * n
279 self.count += n
280 self.avg = self.sum / self.count if self.count > 0 else 0.0
281
282 def __str__(self) -> str:
283 """String representation showing current and average values."""

Callers 5

val_epochMethod · 0.95
train_epochMethod · 0.95
forwardMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected