class_docstr: This criterion computes losses from input (monolingual data in
  translation) with two components:
  1. Reconstruction loss:
  2. LM loss:
  The total loss is a weighted sum of these two components.
class_docstr_tok: ["This","criterion","computes","losses","from","input","(","monolingual","data","in","translation",")","with","two","components",":","1",".","Reconstruction","loss",":","2",".","LM","loss",":","The","total","loss","is","a","weighted","sum","of","these","two","components","."]
code: def __init__(self, args, task):
      super().__init__(args, task)
      self.args = args
      self.alpha = args.reward_alpha
      self.remove_eos_at_src = not args.append_eos_to_source
      self.task = task
  
file_path: translate/pytorch_translate/dual_learning/dual_learning_criterion.py
imports: import math
  import torch
  from fairseq import utils
  from fairseq.criterions import LegacyFairseqCriterion, register_criterion
  from fairseq.scoring import bleu
  from pytorch_translate import beam_decode
  from pytorch_translate.data.weighted_data import WeightedLanguagePairDataset
label_desc: Use image node_id 1 to create a new UnsupervisedCriterion object from inherited base classes: LegacyFairseqCriterion with example: obj = UnsupervisedCriterion(args, task)