class_docstr: Pairwise loss function. :math:`x_p` is the predition score of positive examples,
  and :math:`x_n` is the predition score of negative examples.
  
  .. math::
      \text{loss}(x_p, x_n) = -{\sum_i log \frac{1} {1+\exp(-x_p[i])} +
      \sum_j \frac{1} log(1+\exp(x_n[j])))
class_docstr_tok: ["Pairwise","loss","function",".",":","math",":","`","x_p","`","is","the","predition","score","of","positive","examples",",","and",":","math",":","`","x_n","`","is","the","predition","score","of","negative","examples",".","..","math",":",":","\\text","{","loss","}","(","x_p",",","x_n",")","=","-","{","\\sum_i","log","\\frac","{","1","}","{","1+\\exp","(","-x_p","[","i","]",")","}","+","\\sum_j","\\frac","{","1","}","log","(","1+\\exp","(","x_n","[","j","]",")",")",")"]
code: def __init__(self, adv_temperature=None):
      super(SigmoidLoss, self).__init__()
      self.criterion = nn.LogSigmoid()
      if adv_temperature is not None:
          self.adv_temperature = nn.Parameter(
              torch.Tensor([adv_temperature])
          )
          self.adv_temperature.requires_grad = False
          self.adv_flag = True
      else:
          self.adv_flag = False
  
file_path: graph4nlp/graph4nlp/pytorch/modules/loss/kg_loss.py
imports: import torch
  import torch.nn
  from .base import KGLossBase
label_desc: Use image node_id 1 to create a new SigmoidLoss object from inherited base classes: nn with example: obj = SigmoidLoss(adv_temperature)