class_docstr: Generic Loss interface.
  A loss has a name, a configuration, and stores information about the output and label it requires from the model(s),
  as well as a weight (default 1.0) and a method to create the corresponding metric.
class_docstr_tok: ["Generic","Loss","interface",".","A","loss","has","a","name",",","a","configuration",",","and","stores","information","about","the","output","and","label","it","requires","from","the","model","(","s",")",",","as","well","as","a","weight","(","default","1.0",")","and","a","method","to","create","the","corresponding","metric","."]
code: def __init__(
      self,
      name: str,
      output_name: str,
      label_name: str,
      weight: float = 1.0,
      metric_prefix: str = "",
  ) -> None:
      super().__init__()
      self._name = name
      self._output_name = output_name
      self._label_name = label_name
      self._weight = weight
      self._metric = None  # type: Optional[LossMetric]
      self._metric_prefix = metric_prefix
      logger.info(
          "Loss: %s | weight=%.2f | metric: %s (%s) | output_name: '%s' | label_name: '%s'",
          self._name,
          self.weight,
          self.metric.name,
          self.metric.short_name,
          self.output_name,
          self.label_name,
      )
  
imports: import logging
  import math
  from abc import ABC, abstractmethod
  from typing import Any, Dict, Optional, Tuple
  import torch
  import numpy
  from .None import constants
  from .None import utils
label_desc: Use image node_id 1 to create a new Loss object from inherited base classes: pt.nn with example: obj = Loss(name, output_name, label_name, weight, metric_prefix)