MCPcopy Create free account
hub / github.com/atomicarchitects/equiformer_v2 / AverageMeter

Class AverageMeter

engine.py:12–27  ·  view source on GitHub ↗

Computes and stores the average and current value

Source from the content-addressed store, hash-verified

10
11
12class AverageMeter:
13 """Computes and stores the average and current value"""
14 def __init__(self):
15 self.reset()
16
17 def reset(self):
18 self.val = 0
19 self.avg = 0
20 self.sum = 0
21 self.count = 0
22
23 def update(self, val, n=1):
24 self.val = val
25 self.sum += val * n
26 self.count += n
27 self.avg = self.sum / self.count
28
29
30def train_one_epoch(model: torch.nn.Module, criterion: torch.nn.Module,

Callers 3

train_one_epochFunction · 0.70
evaluateFunction · 0.70
compute_statsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected