class_docstr: stats logging object useful for gathering statistics of training a deep net in pytorch
  Example::
  
      # init stats structure that logs statistics 'objective' and 'top1e'
      stats = Stats( ('objective','top1e') )
      network = init_net() # init a pytorch module (=nueral network)
      dataloader = init_dataloader() # init a dataloader
      for epoch in range(10):
          # start of epoch -> call new_epoch
          stats.new_epoch()
  
          # iterate over batches
          for batch in dataloader:
  
              output = network(batch) # run and save into a dict of output variables
  
              # stats.update() automatically parses the 'objective' and 'top1e' from
              # the "output" dict and stores this into the db
              stats.update(output)
              # prints the metric averages over given epoch
              std_out = stats.get_status_string()
              logger.info(str_out)
          # stores the training plots into '/tmp/epoch_stats.pdf'
          # and plots into a visdom server running at localhost (if running)
          stats.plot_stats(plot_file='/tmp/epoch_stats.pdf')
docstr: stats.print() is deprecated. Please use get_status_string() instead.
  example:
  std_out = stats.get_status_string()
  logger.info(str_out)
docstr_tok: ["stats.print","(",")","is","deprecated",".","Please","use","get_status_string","(",")","instead",".","example",":","std_out","=","stats.get_status_string","(",")","logger.info","(","str_out",")"]
code: def print(
      self,
      max_it=None,
      stat_set="train",
      vars_print=None,
      get_str=False,
      skip_nan=False,
      stat_format=lambda s: s.replace("loss_", "").replace(
          "prev_stage_", "ps_"
      ),
  ):
      """
      stats.print() is deprecated. Please use get_status_string() instead.
      example:
      std_out = stats.get_status_string()
      logger.info(str_out)
      """
  
      epoch = self.epoch
      stats = self.stats
  
      str_out = ""
  
      it = self.it[stat_set]
      stat_str = ""
      stats_print = sorted(stats[stat_set].keys())
      for stat in stats_print:
          if stats[stat_set][stat].count == 0:
              continue
          if skip_nan and not np.isfinite(stats[stat_set][stat].avg):
              continue
          stat_str += " {0:.12}: {1:1.3f} |".format(
              stat_format(stat), stats[stat_set][stat].avg
          )
  
      head_str = "[%s] | epoch %3d | it %5d" % (stat_set, epoch, it)
      if max_it:
          head_str += "/ %d" % max_it
  
      str_out = "%s | %s" % (head_str, stat_str)
  
      if get_str:
          return str_out
      else:
          warnings.warn(
              "get_str=False is deprecated."
              "Please enable this flag to get receive the output string.",
              DeprecationWarning,
          )
          print(str_out)
  
imports: import gzip
  import json
  import logging
  import time
  import warnings
  from collections.abc import Iterable
  from itertools import cycle
  import matplotlib
  import matplotlib.pyplot
  import numpy
  from matplotlib import colors
  from pytorch3d.implicitron.tools.vis_utils import get_visdom_connection
label_desc: Use image node_id 14 for calling the Stats obj's underlying member method code with example usage: obj.print(max_it, stat_set, vars_print, get_str, skip_nan, stat_format) and returns: str_out