class_docstr: Main logger - the aim of this class is to store every log from training
  Log is a float value with corresponding training engine step
class_docstr_tok: ["Main","logger","-","the","aim","of","this","class","is","to","store","every","log","from","training","Log","is","a","float","value","with","corresponding","training","engine","step"]
docstr: Args:
      groups: dictionary with grouped metrics for example the group 'accuracy' can contains different stages
          for example 'validation_accuracy', 'training_accuracy' etc.
      metric_to_name: transformation of metric name which can be used to display name
          we can have short name in the code (acc), but full name on charts (Accuracy)
      from_step: step to show in plots (positive: show steps from this one, negative: show only this many last steps)
      current_step: current step of the train loop
      auto_generate_groups_if_not_available: flag, that enable auto-creation of metric groups
          base on group patterns
      auto_generate_metric_to_name: flag, that enable auto-creation of metric long names
          base on common shortcuts
      group_patterns: you can put there regular expressions to match a few metric names with group
          and replace its name using second value
      step_names: dictionary with a name of x axis for each metrics group or one name for all metrics
docstr_tok: ["Args",":","groups",":","dictionary","with","grouped","metrics","for","example","the","group","'accuracy","'","can","contains","different","stages","for","example","'validation_accuracy","'",",","'training_accuracy","'","etc",".","metric_to_name",":","transformation","of","metric","name","which","can","be","used","to","display","name","we","can","have","short","name","in","the","code","(","acc",")",",","but","full","name","on","charts","(","Accuracy",")","from_step",":","step","to","show","in","plots","(","positive",":","show","steps","from","this","one",",","negative",":","show","only","this","many","last","steps",")","current_step",":","current","step","of","the","train","loop","auto_generate_groups_if_not_available",":","flag",",","that","enable","auto-creation","of","metric","groups","base","on","group","patterns","auto_generate_metric_to_name",":","flag",",","that","enable","auto-creation","of","metric","long","names","base","on","common","shortcuts","group_patterns",":","you","can","put","there","regular","expressions","to","match","a","few","metric","names","with","group","and","replace","its","name","using","second","value","step_names",":","dictionary","with","a","name","of","x","axis","for","each","metrics","group","or","one","name","for","all","metrics"]
code: def __init__(
      self,
      groups: Optional[Dict[str, List[str]]] = None,
      metric_to_name: Optional[Dict[str, str]] = None,
      from_step: int = 0,
      current_step: int = -1,
      auto_generate_groups_if_not_available: bool = True,
      auto_generate_metric_to_name: bool = True,
      group_patterns: Iterable[Tuple[Pattern, str]] = (
          (r"^(?!val(_|-))(.*)", "training"),
          (r"^(val(_|-))(.*)", "validation"),
      ),
      step_names: Union[str, Dict[str, str]] = "epoch",
  ):
      """
      Args:
          groups: dictionary with grouped metrics for example the group 'accuracy' can contains different stages
              for example 'validation_accuracy', 'training_accuracy' etc.
          metric_to_name: transformation of metric name which can be used to display name
              we can have short name in the code (acc), but full name on charts (Accuracy)
          from_step: step to show in plots (positive: show steps from this one, negative: show only this many last steps)
          current_step: current step of the train loop
          auto_generate_groups_if_not_available: flag, that enable auto-creation of metric groups
              base on group patterns
          auto_generate_metric_to_name: flag, that enable auto-creation of metric long names
              base on common shortcuts
          group_patterns: you can put there regular expressions to match a few metric names with group
              and replace its name using second value
          step_names: dictionary with a name of x axis for each metrics group or one name for all metrics
      """
      self.log_history = {}
      self.groups = groups if groups is not None else {}
      self.metric_to_name = metric_to_name if metric_to_name else {}
      self.from_step = from_step
      self.current_step = current_step
      self.auto_generate_groups = all(
          (not groups, auto_generate_groups_if_not_available)
      )
      self.auto_generate_metric_to_name = auto_generate_metric_to_name
      self.group_patterns = tuple(
          (re.compile(pattern), replace_with)
          for pattern, replace_with in group_patterns
      )
      if isinstance(step_names, str):
          self.step_names = defaultdict(lambda: step_names)
      else:
          self.step_names = defaultdict(lambda: "epoch", step_names)
  
file_path: livelossplot/livelossplot/main_logger.py
imports: import re
  from collections import OrderedDict, defaultdict
  from typing import NamedTuple, Dict, Iterable, List, Pattern, Tuple, Optional, Union
label_desc: Use image node_id 1 to create a new MainLogger object  with example: obj = MainLogger(groups, metric_to_name, from_step, current_step, auto_generate_groups_if_not_available, auto_generate_metric_to_name, group_patterns, step_names)