class_docstr: Abstract class for the loss function.
class_docstr_tok: ["Abstract","class","for","the","loss","function","."]
docstr: Initialize the loss..
  
  Parameters
  ----------
  hyperparam_dict : dict
      Dictionary of hyperparams.
  
      - `"reduction"`: (str) - Specifies whether to `"sum"` or take the `"mean"` of loss per sample w.r.t.                  corruptions (default: `"sum"`).
  
      Other Keys are described in the `hyperparameters` section.
docstr_tok: ["Initialize","the","loss","..","Parameters","--","--","--","--","--","hyperparam_dict",":","dict","Dictionary","of","hyperparams",".","-","`","``","reduction","''","`",":","(","str",")","-","Specifies","whether","to","`","``","sum","''","`","or","take","the","`","``","mean","''","`","of","loss","per","sample","w.r.t",".","corruptions","(","default",":","`","``","sum","''","`",")",".","Other","Keys","are","described","in","the","`","hyperparameters","`","section","."]
code: def __init__(self, hyperparam_dict={}, verbose=False):
      """Initialize the loss..
  
          Parameters
          ----------
          hyperparam_dict : dict
              Dictionary of hyperparams.
  
              - `"reduction"`: (str) - Specifies whether to `"sum"` or take the `"mean"` of loss per sample w.r.t. \
                   corruptions (default: `"sum"`).
  
              Other Keys are described in the `hyperparameters` section.
          """
      self._loss_parameters = {}
      self._loss_parameters["reduction"] = hyperparam_dict.get(
          "reduction", DEFAULT_REDUCTION
      )
      assert self._loss_parameters["reduction"] in [
          "sum",
          "mean",
      ], "Invalid value for reduction!"
      self._dependencies = []
      self._user_losses = self.name
      self._user_loss_weights = None
  
      self._loss_metric = metrics_mod.Mean(name="loss")  # Total loss.
  
      # perform check to see if all the required external hyperparams are
      # passed
      try:
          self._init_hyperparams(hyperparam_dict)
          if verbose:
              logger.info("\n--------- Loss ---------")
              logger.info("Name : {}".format(self.name))
              for key, value in self._loss_parameters.items():
                  logger.info("{} : {}".format(key, value))
      except KeyError as e:
          msg = "Some of the hyperparams for loss were not passed to the loss function.\n{}".format(
              e
          )
          logger.error(msg)
          raise Exception(msg)
  
imports: import abc
  import logging
  import six
  import tensorflow
  from tensorflow.python.keras import metrics
  from tensorflow.python.keras.utils import losses_utils
  from tensorflow.python.ops import math_ops
label_desc: Use image node_id 1 to create a new Loss object from inherited base classes: abc with example: obj = Loss(hyperparam_dict, verbose)