MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / AverageMeter

Class AverageMeter

examples/pytorch/vit/ViT-quantization/eval_engine.py:48–63  ·  view source on GitHub ↗

Computes and stores the average and current value

Source from the content-addressed store, hash-verified

46logger.setLevel(logging.DEBUG)
47
48class AverageMeter(object):
49 """Computes and stores the average and current value"""
50 def __init__(self):
51 self.reset()
52
53 def reset(self):
54 self.val = 0
55 self.avg = 0
56 self.sum = 0
57 self.count = 0
58
59 def update(self, val, n=1):
60 self.val = val
61 self.sum += val * n
62 self.count += n
63 self.avg = self.sum / self.count
64
65class Knowledge_Distillation_Loss(torch.nn.Module):
66 def __init__(self, scale, T = 3):

Callers 3

validFunction · 0.70
validate_trtFunction · 0.70
trainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected