original_docstring: Add new information to the logs.
docstring: Add new information to the logs.
docstring_tokens: Add new information to the logs .
code: def add_values(self, info, epoch, ignore: list = None):
          """Add new information to the logs."""
  
          ignore = [] if ignore is None else ignore
  
          for composite_name, value in info.items():
              tokens = composite_name.split('_')
              if len(tokens) == 1:
                  # Ordinary metric (non-classwise); e.g. loss, iou, precision
                  name = composite_name
                  if name in ignore:
                      continue
                  elif name in self.metrics:
                      self.metric_values[name].write(tsv_line(epoch, value.avg))
                  elif name in self.metrics_classwise:  # Metrics averaged over classes
                      self.averaged_scores[name].write(tsv_line(epoch, value.avg))
                  else:
                      warnings.warn(f'Unknown metric {name}')
              elif len(tokens) == 2:
                  # Classwise metric; e.g. precision_0, recall_1
                  name, class_idx = tokens
                  if name in ignore:
                      continue
                  elif name in self.metrics_classwise:
                      self.class_scores[name].write(tsv_line(epoch, class_idx, value.avg))
                  else:
                      warnings.warn(f'Unknown metric {name}')
code_tokens: def add_values ( self , info , epoch , ignore : list = None ) : ignore = [ ] if ignore is None else ignore for composite_name , value in info . items ( ) : tokens = composite_name . split ( '_' ) if len ( tokens ) == 1 : name = composite_name if name in ignore : continue elif name in self . metrics : self . metric_values [ name ] . write ( tsv_line ( epoch , value . avg ) ) elif name in self . metrics_classwise : self . averaged_scores [ name ] . write ( tsv_line ( epoch , value . avg ) ) else : warnings . warn ( f'Unknown metric {name}' ) elif len ( tokens ) == 2 : name , class_idx = tokens if name in ignore : continue elif name in self . metrics_classwise : self . class_scores [ name ] . write ( tsv_line ( epoch , class_idx , value . avg ) ) else : warnings . warn ( f'Unknown metric {name}' )
short_docstring: Add new information to the logs.
short_docstring_tokens: Add new information to the logs .
comment: """Add new information to the logs."""$SEP$# Ordinary metric (non-classwise); e.g. loss, iou, precision$SEP$# Metrics averaged over classes$SEP$# Classwise metric; e.g. precision_0, recall_1