class_docstr: Implements a combined loss from translation and target words prediction.
class_docstr_tok: ["Implements","a","combined","loss","from","translation","and","target","words","prediction","."]
docstr: Loss function that maximizes the confidence of the true positive.
  
  Args:
      prediction: Prediction that was made by the model of shape
                  [BATCH_SIZE, N_LABELS]
      target: Expected result of shape [BATCH_SIZE, N_OUTPUT_TOKENS]
  
  Returns:
      loss: Loss as a torch.Variable
docstr_tok: ["Loss","function","that","maximizes","the","confidence","of","the","true","positive",".","Args",":","prediction",":","Prediction","that","was","made","by","the","model","of","shape","[","BATCH_SIZE",",","N_LABELS","]","target",":","Expected","result","of","shape","[","BATCH_SIZE",",","N_OUTPUT_TOKENS","]","Returns",":","loss",":","Loss","as","a","torch.Variable"]
code: def predictor_loss_function(self, prediction, target):
      """Loss function that maximizes the confidence of the true positive.
  
      Args:
          prediction: Prediction that was made by the model of shape
                      [BATCH_SIZE, N_LABELS]
          target: Expected result of shape [BATCH_SIZE, N_OUTPUT_TOKENS]
  
      Returns:
          loss: Loss as a torch.Variable
      """
      return -(prediction.gather(dim=-1, index=target))
  
imports: import abc
  import math
  import torch
  from fairseq import utils
  from fairseq.criterions import register_criterion
  from fairseq.criterions.label_smoothed_cross_entropy import LabelSmoothedCrossEntropyCriterion
  from pytorch_translate.utils import maybe_cuda
label_desc: Use image node_id 1 for calling the WordPredictionCriterion obj's underlying member method code with example usage: obj.predictor_loss_function(prediction, target) and returns: unknown