class_docstr: Pairwise, max-margin loss.
  
  Introduced in :cite:`bordes2013translating`.
  
  .. math::
  
      \mathcal{L}(\Theta) = \sum_{t^+ \in \mathcal{G}}\sum_{t^- \in \mathcal{C}}max(0, [\gamma + f_{model}(t^-;\Theta)
       - f_{model}(t^+;\Theta)])
  
  where :math:`\gamma` is the margin, :math:`\mathcal{G}` is the set of positives,
  :math:`\mathcal{C}` is the set of corruptions, :math:`f_{model}(t;\Theta)` is the model-specific scoring function.
  
  Example
  -------
  >>> import ampligraph.latent_features.loss_functions as lfs
  >>> loss = lfs.PairwiseLoss({'margin': 0.005, 'reduction': 'sum'})
  >>> isinstance(loss, lfs.PairwiseLoss)
  True
  
  >>> loss = lfs.get('pairwise')
  >>> isinstance(loss, lfs.PairwiseLoss)
  True
class_docstr_tok: ["Pairwise",",","max-margin","loss",".","Introduced","in",":","cite",":","`","bordes2013translating","`",".","..","math",":",":","\\mathcal","{","L","}","(","\\Theta",")","=","\\sum_","{","t^+","\\in","\\mathcal","{","G","}","}","\\sum_","{","t^-","\\in","\\mathcal","{","C","}","}","max","(","0",",","[","\\gamma","+","f_","{","model","}","(","t^-",";","\\Theta",")","-","f_","{","model","}","(","t^+",";","\\Theta",")","]",")","where",":","math",":","`","\\gamma","`","is","the","margin",",",":","math",":","`","\\mathcal","{","G","}","`","is","the","set","of","positives",",",":","math",":","`","\\mathcal","{","C","}","`","is","the","set","of","corruptions",",",":","math",":","`","f_","{","model","}","(","t",";","\\Theta",")","`","is","the","model-specific","scoring","function",".","Example","--","--","--","-",">",">",">","import","ampligraph.latent_features.loss_functions","as","lfs",">",">",">","loss","=","lfs.PairwiseLoss","(","{","'margin","'",":","0.005",",","'reduction","'",":","'sum","'","}",")",">",">",">","isinstance","(","loss",",","lfs.PairwiseLoss",")","True",">",">",">","loss","=","lfs.get","(","'pairwise","'",")",">",">",">","isinstance","(","loss",",","lfs.PairwiseLoss",")","True"]
docstr: Verifies and stores the hyperparameters needed by the algorithm.
  
  Parameters
  ----------
  hyperparam_dict : dict
      The Loss will check the keys to get the corresponding parameter.
  
      - `"margin"`: (str) - Margin to be used in pairwise loss computation (default: 1).
docstr_tok: ["Verifies","and","stores","the","hyperparameters","needed","by","the","algorithm",".","Parameters","--","--","--","--","--","hyperparam_dict",":","dict","The","Loss","will","check","the","keys","to","get","the","corresponding","parameter",".","-","`","``","margin","''","`",":","(","str",")","-","Margin","to","be","used","in","pairwise","loss","computation","(","default",":","1",")","."]
code: def _init_hyperparams(self, hyperparam_dict={}):
      """Verifies and stores the hyperparameters needed by the algorithm.
  
      Parameters
      ----------
      hyperparam_dict : dict
          The Loss will check the keys to get the corresponding parameter.
  
          - `"margin"`: (str) - Margin to be used in pairwise loss computation (default: 1).
      """
      self._loss_parameters["margin"] = hyperparam_dict.get(
          "margin", DEFAULT_MARGIN
      )
  
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 2 for calling the PairwiseLoss obj's underlying member method code with example usage: obj._init_hyperparams(hyperparam_dict) without return types