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

Class AverageMeter

dali/test/python/test_utils.py:705–724  ·  view source on GitHub ↗

Computes and stores the average and current value

Source from the content-addressed store, hash-verified

703
704
705class AverageMeter(object):
706 """Computes and stores the average and current value"""
707
708 def __init__(self):
709 self.reset()
710
711 def reset(self):
712 self.val = 0
713 self.avg = 0
714 self.sum = 0
715 self.count = 0
716 self.avg_last_n = 0
717 self.max_val = 0
718
719 def update(self, val, n=1):
720 self.val = val
721 self.max_val = max(self.max_val, val)
722 self.sum += val * n
723 self.count += n
724 self.avg = self.sum / self.count
725
726
727def to_array(dali_out):

Callers 4

training_testFunction · 0.90
iteration_testFunction · 0.90

Calls

no outgoing calls

Tested by 3

training_testFunction · 0.72
iteration_testFunction · 0.72