MCPcopy Create free account
hub / github.com/YUE-FAN/CoSSL / AverageMeter

Class AverageMeter

utils/misc.py:59–76  ·  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

57 raise
58
59class AverageMeter(object):
60 """Computes and stores the average and current value
61 Imported from https://github.com/pytorch/examples/blob/master/imagenet/main.py#L247-L262
62 """
63 def __init__(self):
64 self.reset()
65
66 def reset(self):
67 self.val = 0
68 self.avg = 0
69 self.sum = 0
70 self.count = 0
71
72 def update(self, val, n=1):
73 self.val = val
74 self.sum += val * n
75 self.count += n
76 self.avg = self.sum / self.count
77
78
79class Cycle(object):

Callers 15

trainFunction · 0.90
validate_teacherFunction · 0.90
classifier_trainFunction · 0.90
trainFunction · 0.90
validate_teacherFunction · 0.90
trainFunction · 0.90
validateFunction · 0.90
classifier_trainFunction · 0.90
trainFunction · 0.90
validate_teacherFunction · 0.90
annotate_unlabeled_dataFunction · 0.90
trainFunction · 0.90

Calls

no outgoing calls

Tested by 2

validateFunction · 0.72
validate_cosslFunction · 0.72