class_docstr: Measures training stats.
code: def get_epoch_stats(self, cur_epoch):
      cur_iter_total = (cur_epoch + 1) * self.epoch_iters
      eta_sec = self.iter_timer.average_time * (
          self.max_iter - cur_iter_total
      )
      mem_usage = gpu_mem_usage()
      top1_err = self.num_top1_mis / self.num_samples
      top5_err = self.num_top5_mis / self.num_samples
      avg_loss = self.loss_total / self.num_samples
      stats = {
          "epoch": "{}/{}".format(cur_epoch + 1, cfg.OPTIM.MAX_EPOCH),
          "time_avg": self.iter_timer.average_time,
          "time_epoch": self.iter_timer.average_time * self.epoch_iters,
          "eta": time_string(eta_sec),
          "top1_err": top1_err,
          "top5_err": top5_err,
          "loss": avg_loss,
          "lr": self.lr,
          "mem": int(np.ceil(mem_usage)),
      }
      return stats
  
imports: from collections import deque
  import numpy
  import pycls.core.logging
  import torch
  from pycls.core.config import cfg
  from pycls.core.timer import Timer
label_desc: Use image node_id 8 for calling the TrainMeter obj's underlying member method code with example usage: obj.get_epoch_stats(cur_epoch) and returns: stats