MCPcopy Create free account
hub / github.com/OSVAI/ODConv / AverageMeter

Class AverageMeter

utils/misc.py:34–51  ·  view source on GitHub ↗

Computes and stores the average and current value Imported from https://github.com/pytorch/examples/blob/master/imagenet/main.py#L247-L262

Source from the content-addressed store, hash-verified

32
33
34class AverageMeter(object):
35 """Computes and stores the average and current value
36 Imported from https://github.com/pytorch/examples/blob/master/imagenet/main.py#L247-L262
37 """
38 def __init__(self):
39 self.reset()
40
41 def reset(self):
42 self.val = 0
43 self.avg = 0
44 self.sum = 0
45 self.count = 0
46
47 def update(self, val, n=1):
48 self.val = val
49 self.sum += val * n
50 self.count += n
51 self.avg = self.sum / self.count
52
53
54def get_temperature(iteration, epoch, iter_per_epoch, temp_epoch=10, temp_init=30.0):

Callers 2

trainFunction · 0.90
testFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected