class_docstr: loss generator class is responsible for calculate loss for positive & negative loss / pairwise loss.
  It has different implementations of concrete method in regards of PyTorch and MXNet.
docstr: Calculate total loss for a batch of positive triples and negative triples.
  The total loss can be point-wise and pairwise. For pairwise, it is average of the relative loss from positive score to negative
  score. For point-wise, it can be average of the positive loss and negative loss or negative loss
  weighted by its negative score and adversarial_temperature.
  
  If pairwise:
  \mathcal{L} = rac{1}{|B|} \sum_{(t_i^+, t_i^-) \in B} L(f(t_i^-) - f(t_i^+)) \cdot w_{e_i}
  \mathcal{L} : total loss
  B : batch
  L : local loss criterion
  f : score function
  t_i^- : negative sample for triple i
  t_i^+ : positive sample for triple i
  w_{e_i} : weight for edge i
  
  If neg_adversarial_sampling:
  L_{adv\_neg} = \sum_{t_i^- \in B} softmax(f(t_i^-) \cdot T) \cdot L_{neg}
  B : batch
  L_{adv\_neg}-> adversarial weighed negative loss
  L_{neg} : negative loss
  f : score function
  t_i^- : negative sample for triple i
  T : adversarial temperature (hyper-parameter)
  
  Parameters
  ----------
  pos_score : tensor
      Score calculated from positive triples
  neg_score : tensor
      Score calculated from negative triples
  edge_weight : tensor
      weight for each edge
  
  Returns
  -------
  tensor
      Total loss by aggregate positive score and negative score.
  log
      log to record scalar value of negative loss, positive loss and/or total loss
docstr_tok: ["Calculate","total","loss","for","a","batch","of","positive","triples","and","negative","triples",".","The","total","loss","can","be","point-wise","and","pairwise",".","For","pairwise",",","it","is","average","of","the","relative","loss","from","positive","score","to","negative","score",".","For","point-wise",",","it","can","be","average","of","the","positive","loss","and","negative","loss","or","negative","loss","weighted","by","its","negative","score","and","adversarial_temperature",".","If","pairwise",":","\\mathcal","{","L","}","=","rac","{","1","}","{","|B|","}","\\sum_","{","(","t_i^+",",","t_i^-",")","\\in","B","}","L","(","f","(","t_i^-",")","-","f","(","t_i^+",")",")","\\cdot","w_","{","e_i","}","\\mathcal","{","L","}",":","total","loss","B",":","batch","L",":","local","loss","criterion","f",":","score","function","t_i^-",":","negative","sample","for","triple","i","t_i^+",":","positive","sample","for","triple","i","w_","{","e_i","}",":","weight","for","edge","i","If","neg_adversarial_sampling",":","L_","{","adv\\_neg","}","=","\\sum_","{","t_i^-","\\in","B","}","softmax","(","f","(","t_i^-",")","\\cdot","T",")","\\cdot","L_","{","neg","}","B",":","batch","L_","{","adv\\_neg","}","-",">","adversarial","weighed","negative","loss","L_","{","neg","}",":","negative","loss","f",":","score","function","t_i^-",":","negative","sample","for","triple","i","T",":","adversarial","temperature","(","hyper-parameter",")","Parameters","--","--","--","--","--","pos_score",":","tensor","Score","calculated","from","positive","triples","neg_score",":","tensor","Score","calculated","from","negative","triples","edge_weight",":","tensor","weight","for","each","edge","Returns","--","--","--","-","tensor","Total","loss","by","aggregate","positive","score","and","negative","score",".","log","log","to","record","scalar","value","of","negative","loss",",","positive","loss","and\/or","total","loss"]
code: def get_total_loss(self, pos_score, neg_score, edge_weight):
      """Calculate total loss for a batch of positive triples and negative triples.
      The total loss can be point-wise and pairwise. For pairwise, it is average of the relative loss from positive score to negative
      score. For point-wise, it can be average of the positive loss and negative loss or negative loss
      weighted by its negative score and adversarial_temperature.
  
      If pairwise:
      \mathcal{L} = \frac{1}{|B|} \sum_{(t_i^+, t_i^-) \in B} L(f(t_i^-) - f(t_i^+)) \cdot w_{e_i}
      \mathcal{L} : total loss
      B : batch
      L : local loss criterion
      f : score function
      t_i^- : negative sample for triple i
      t_i^+ : positive sample for triple i
      w_{e_i} : weight for edge i
  
      If neg_adversarial_sampling:
      L_{adv\_neg} = \sum_{t_i^- \in B} softmax(f(t_i^-) \cdot T) \cdot L_{neg}
      B : batch
      L_{adv\_neg}-> adversarial weighed negative loss
      L_{neg} : negative loss
      f : score function
      t_i^- : negative sample for triple i
      T : adversarial temperature (hyper-parameter)
  
      Parameters
      ----------
      pos_score : tensor
          Score calculated from positive triples
      neg_score : tensor
          Score calculated from negative triples
      edge_weight : tensor
          weight for each edge
  
      Returns
      -------
      tensor
          Total loss by aggregate positive score and negative score.
      log
          log to record scalar value of negative loss, positive loss and/or total loss
      """
      pass
  
label_desc: Use image node_id 4 for calling the BaseLossGenerator obj's underlying member method code with example usage: obj.get_total_loss(pos_score, neg_score, edge_weight) without return types