MCPcopy
hub / github.com/Audio-AGI/AudioSep / AverageMeter

Class AverageMeter

models/CLAP/training/train.py:22–38  ·  view source on GitHub ↗

Computes and stores the average and current value

Source from the content-addressed store, hash-verified

20
21
22class AverageMeter(object):
23 """Computes and stores the average and current value"""
24
25 def __init__(self):
26 self.reset()
27
28 def reset(self):
29 self.val = 0
30 self.avg = 0
31 self.sum = 0
32 self.count = 0
33
34 def update(self, val, n=1):
35 self.val = val
36 self.sum += val * n
37 self.count += n
38 self.avg = self.sum / self.count
39
40
41def unwrap_model(model):

Callers 1

train_one_epochFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected