class_docstr: Simple helper class to log once in a while or when progress is quick enough
code: def log(self, metric, progress, force=False):
      now = time.monotonic()
      if (
          force
          or now > self.last_time + self.time_interval
          or progress > self.last_progress + self.progress_interval
      ):
          self.last_time = now
          self.last_progress = progress
          _LG.info_on_master(
              "train: %s [%3d%%]", metric, 100 * progress
          )
  
file_path: audio/examples/source_separation/conv_tasnet/trainer.py
imports: import time
  from collections import namedtuple
  from typing import Tuple
  import torch
  import torch.distributed
  from utils import dist_utils, metrics
label_desc: Use image node_id 2 for calling the OccasionalLogger obj's underlying member method code with example usage: obj.log(metric, progress, force) without return types