class_docstr: An architecture to jointly train primal model and dual model by leveraging
  distribution duality, which exist for both parallel data and monolingual
  data.
class_docstr_tok: ["An","architecture","to","jointly","train","primal","model","and","dual","model","by","leveraging","distribution","duality",",","which","exist","for","both","parallel","data","and","monolingual","data","."]
code: def __init__(
      self, args, task, primal_model, dual_model, lm_model=None
  ):
      super().__init__()
      self.args = args
      self.task_keys = ["primal", "dual"]
      self.models = nn.ModuleDict(
          {"primal": primal_model, "dual": dual_model, "lm": lm_model}
      )
  
file_path: translate/pytorch_translate/dual_learning/dual_learning_models.py
imports: import logging
  import torch.nn
  from fairseq import checkpoint_utils
  from fairseq.models import BaseFairseqModel, register_model
  from pytorch_translate import rnn
  from pytorch_translate.rnn import base_architecture, LSTMSequenceEncoder, RNNDecoder, RNNEncoder, RNNModel
  from pytorch_translate.tasks.pytorch_translate_task import PytorchTranslateTask
label_desc: Use image node_id 1 to create a new DualLearningModel object from inherited base classes: BaseFairseqModel with example: obj = DualLearningModel(args, task, primal_model, dual_model, lm_model)