AverageMeter#

class deepinv.utils.AverageMeter(name, fmt=':f')[source]#

Bases: object

Compute and store aggregates online from a stream of scalar values

The supported aggregates are: - vals: the list of all processed values - val: the last value processed - avg: the average of all processed values - sum: the sum of all processed values - count: the number of processed values - std: the standard deviation of all processed values - sum2: the sum of squares of all processed values

Parameters:
  • name (str) – meter name for printing

  • fmt (str) – meter format for printing

reset()[source]#

Reset the stored aggregates.

update(val, n=1)[source]#

Process new scalar value(s) and update the stored aggregates.

Parameters:
  • val (numpy.ndarray, float, int) – either array (i.e. batch) of values or single value

  • n (int) – weight, defaults to 1