class_docstr: Loss functions.
  
  Args:
      name (str):
          Loss function name.
      margin (float, optional):
          Margin parameter for MarginRankingLoss.
      pairwise (bool, optional):
          Whether compute loss of positive and negative samples pairwise.
      neg_adv_spl (bool, optional):
          Whether use negative adversarial sampling.
      neg_adv_temp (float, optional):
          Temperature of negative adversarial sampling.
class_docstr_tok: ["Loss","functions",".","Args",":","name","(","str",")",":","Loss","function","name",".","margin","(","float",",","optional",")",":","Margin","parameter","for","MarginRankingLoss",".","pairwise","(","bool",",","optional",")",":","Whether","compute","loss","of","positive","and","negative","samples","pairwise",".","neg_adv_spl","(","bool",",","optional",")",":","Whether","use","negative","adversarial","sampling",".","neg_adv_temp","(","float",",","optional",")",":","Temperature","of","negative","adversarial","sampling","."]
code: def __init__(
      self,
      name="LogSigmoid",
      margin=4.0,
      pairwise=False,
      neg_adv_spl=False,
      neg_adv_temp=0.0,
  ):
      super(LossFunction, self).__init__()
      self.name = name
      self.margin = margin
      self.pairwise = pairwise
      self.loss_func = self.get_loss_func()
  
      self.neg_adv_spl = neg_adv_spl
      self.neg_adv_temp = neg_adv_temp
  
file_path: PGL/apps/Graph4KG/models/loss_func.py
imports: import paddle
  from paddle.nn import BCELoss, MarginRankingLoss
  from paddle.nn.functional import log_sigmoid, softmax, softplus
label_desc: Use image node_id 1 to create a new LossFunction object from inherited base classes: object with example: obj = LossFunction(name, margin, pairwise, neg_adv_spl, neg_adv_temp)