class_docstr: Track the result of an epoch.
  
  Args:
      metrics_for_best_model: A set of entry to calculate validation score.
      mode: (default = None) "train" or "valid" mode.
      axes: (default = None) The timestamp for the moment.
class_docstr_tok: ["Track","the","result","of","an","epoch",".","Args",":","metrics_for_best_model",":","A","set","of","entry","to","calculate","validation","score",".","mode",":","(","default","=","None",")","``","train","''","or","``","valid","''","mode",".","axes",":","(","default","=","None",")","The","timestamp","for","the","moment","."]
code: def __init__(
      self,
      metrics_for_best_model: Optional[Set[str]] = None,
      mode: Optional[str] = None,
      axes: Optional[Timestamp] = None,
      metrics_results: Optional[dict] = None,
  ):
      # loss
      self._avg_loss = 0.0
      self._accumulate_step = 0
  
      # metrics
      self._metrics_results = dict()
      self.is_best_valid = False
  
      # result: loss & metrics
      self._score = None
  
      self._start_time = -math.inf
      self._end_time = math.inf
      self.mode = mode or "Epoch"
      self.axes = axes if axes is not None else Timestamp()
      self.metrics_for_best_model = metrics_for_best_model or set()
      if self.mode == "train":
          self.desc = "Train epoch "
          self.serial = self.axes.train_epoch
      elif self.mode == "valid":
          self.desc = " Validation "
          self.serial = self.axes.valid_epoch
      else:
          self.desc = "Epoch "
          self.serial = ""
      self._has_score = False
      self._has_loss = False
  
      if metrics_results is not None:
          self._update_metrics(metrics_results)
  
imports: from contextlib import contextmanager
  from copy import copy
  from accelerate.logging import get_logger
  import math
  import os
  from time import time
  from typing import Iterable, Optional, Set, Union, Callable
  import traceback
  import torch
  import wandb
  from wandb import AlertLevel
  from textbox.config.configurator import Config
label_desc: Use image node_id 1 to create a new EpochTracker object  with example: obj = EpochTracker(metrics_for_best_model, mode, axes, metrics_results)