class_docstr: Realize the BackMapping translation matrix which maps the source model's document vector
  to the target model's document vector (old model).
  
  BackMapping translation matrix is used to learn a mapping for two document vector spaces which we
  specify as source document vector and target document vector. The target document vectors are trained
  on a superset corpus of source document vectors; we can incrementally increase the vector in
  the old model through the BackMapping translation matrix.
  
  For details on use, see the tutorial notebook [3]_.
  
  Examples
  --------
  .. sourcecode:: pycon
  
      >>> from gensim.test.utils import datapath
      >>> from gensim.test.test_translation_matrix import read_sentiment_docs
      >>> from gensim.models import Doc2Vec, BackMappingTranslationMatrix
      >>>
      >>> data = read_sentiment_docs(datapath("alldata-id-10.txt"))[:5]
      >>> src_model = Doc2Vec.load(datapath("small_tag_doc_5_iter50"))
      >>> dst_model = Doc2Vec.load(datapath("large_tag_doc_10_iter50"))
      >>>
      >>> model_trans = BackMappingTranslationMatrix(src_model, dst_model)
      >>> trans_matrix = model_trans.train(data)
      >>>
      >>> result = model_trans.infer_vector(dst_model.dv[data[3].tags])
class_docstr_tok: ["Realize","the","BackMapping","translation","matrix","which","maps","the","source","model","'s","document","vector","to","the","target","model","'s","document","vector","(","old","model",")",".","BackMapping","translation","matrix","is","used","to","learn","a","mapping","for","two","document","vector","spaces","which","we","specify","as","source","document","vector","and","target","document","vector",".","The","target","document","vectors","are","trained","on","a","superset","corpus","of","source","document","vectors",";","we","can","incrementally","increase","the","vector","in","the","old","model","through","the","BackMapping","translation","matrix",".","For","details","on","use",",","see","the","tutorial","notebook","[","3","]","_",".","Examples","--","--","--","--","..","sourcecode",":",":","pycon",">",">",">","from","gensim.test.utils","import","datapath",">",">",">","from","gensim.test.test_translation_matrix","import","read_sentiment_docs",">",">",">","from","gensim.models","import","Doc2Vec",",","BackMappingTranslationMatrix",">",">",">",">",">",">","data","=","read_sentiment_docs","(","datapath","(","``","alldata-id-10.txt","''",")",")","[",":5","]",">",">",">","src_model","=","Doc2Vec.load","(","datapath","(","``","small_tag_doc_5_iter50","''",")",")",">",">",">","dst_model","=","Doc2Vec.load","(","datapath","(","``","large_tag_doc_10_iter50","''",")",")",">",">",">",">",">",">","model_trans","=","BackMappingTranslationMatrix","(","src_model",",","dst_model",")",">",">",">","trans_matrix","=","model_trans.train","(","data",")",">",">",">",">",">",">","result","=","model_trans.infer_vector","(","dst_model.dv","[","data","[","3","]",".tags","]",")"]
docstr: Translate the target model's document vector to the source model's document vector
  
  Parameters
  ----------
  target_doc_vec : numpy.ndarray
      Document vector from the target document, whose document are not in the source model.
  
  Returns
  -------
  numpy.ndarray
      Vector `target_doc_vec` in the source model.
docstr_tok: ["Translate","the","target","model","'s","document","vector","to","the","source","model","'s","document","vector","Parameters","--","--","--","--","--","target_doc_vec",":","numpy.ndarray","Document","vector","from","the","target","document",",","whose","document","are","not","in","the","source","model",".","Returns","--","--","--","-","numpy.ndarray","Vector","`","target_doc_vec","`","in","the","source","model","."]
code: def infer_vector(self, target_doc_vec):
      """Translate the target model's document vector to the source model's document vector
  
      Parameters
      ----------
      target_doc_vec : numpy.ndarray
          Document vector from the target document, whose document are not in the source model.
  
      Returns
      -------
      numpy.ndarray
          Vector `target_doc_vec` in the source model.
  
      """
      return np.dot(target_doc_vec, self.translation_matrix)
  
imports: import warnings
  from collections import OrderedDict
  import numpy
  from gensim import utils
label_desc: Use image node_id 3 for calling the BackMappingTranslationMatrix obj's underlying member method code with example usage: obj.infer_vector(target_doc_vec) and returns: np