code: def __init__(self, mode, length, calculate_mean=False):
      self.mode = mode
      self.length = length
      self.calculate_mean = calculate_mean
      if self.calculate_mean:
          self.fn = lambda x, i: x / (i + 1)
      else:
          self.fn = lambda x, i: x
  
file_path: facenet-pytorch/models/utils/training.py
imports: import torch
  import numpy
  import time
label_desc: Use image node_id 1 to create a new Logger object from inherited base classes: object with example: obj = Logger(mode, length, calculate_mean)