class_docstr: Train and use Online Latent Dirichlet Allocation model as presented in
  `'Online Learning for LDA' by Hoffman et al.`_
  
  Examples
  -------
  Initialize a model using a Gensim corpus
  
  .. sourcecode:: pycon
  
      >>> from gensim.test.utils import common_corpus
      >>>
      >>> lda = LdaModel(common_corpus, num_topics=10)
  
  You can then infer topic distributions on new, unseen documents.
  
  .. sourcecode:: pycon
  
      >>> doc_bow = [(1, 0.3), (2, 0.1), (0, 0.09)]
      >>> doc_lda = lda[doc_bow]
  
  The model can be updated (trained) with new documents.
  
  .. sourcecode:: pycon
  
      >>> # In practice (corpus =/= initial training corpus), but we use the same here for simplicity.
      >>> other_corpus = common_corpus
      >>>
      >>> lda.update(other_corpus)
  
  Model persistency is achieved through :meth:`~gensim.models.ldamodel.LdaModel.load` and
  :meth:`~gensim.models.ldamodel.LdaModel.save` methods.
class_docstr_tok: ["Train","and","use","Online","Latent","Dirichlet","Allocation","model","as","presented","in","`","'Online","Learning","for","LDA","'","by","Hoffman","et","al.","`","_","Examples","--","--","--","-","Initialize","a","model","using","a","Gensim","corpus","..","sourcecode",":",":","pycon",">",">",">","from","gensim.test.utils","import","common_corpus",">",">",">",">",">",">","lda","=","LdaModel","(","common_corpus",",","num_topics=10",")","You","can","then","infer","topic","distributions","on","new",",","unseen","documents",".","..","sourcecode",":",":","pycon",">",">",">","doc_bow","=","[","(","1",",","0.3",")",",","(","2",",","0.1",")",",","(","0",",","0.09",")","]",">",">",">","doc_lda","=","lda","[","doc_bow","]","The","model","can","be","updated","(","trained",")","with","new","documents",".","..","sourcecode",":",":","pycon",">",">",">","#","In","practice","(","corpus","=\/=","initial","training","corpus",")",",","but","we","use","the","same","here","for","simplicity",".",">",">",">","other_corpus","=","common_corpus",">",">",">",">",">",">","lda.update","(","other_corpus",")","Model","persistency","is","achieved","through",":","meth",":","`","~gensim.models.ldamodel.LdaModel.load","`","and",":","meth",":","`","~gensim.models.ldamodel.LdaModel.save","`","methods","."]
docstr: Maximization step: use linear interpolation between the existing topics and
  collected sufficient statistics in `other` to update the topics.
  
  Parameters
  ----------
  rho : float
      Learning rate.
  other : :class:`~gensim.models.ldamodel.LdaModel`
      The model whose sufficient statistics will be used to update the topics.
  extra_pass : bool, optional
      Whether this step required an additional pass over the corpus.
docstr_tok: ["Maximization","step",":","use","linear","interpolation","between","the","existing","topics","and","collected","sufficient","statistics","in","`","other","`","to","update","the","topics",".","Parameters","--","--","--","--","--","rho",":","float","Learning","rate",".","other",":",":","class",":","`","~gensim.models.ldamodel.LdaModel","`","The","model","whose","sufficient","statistics","will","be","used","to","update","the","topics",".","extra_pass",":","bool",",","optional","Whether","this","step","required","an","additional","pass","over","the","corpus","."]
code: def do_mstep(self, rho, other, extra_pass=False):
      """Maximization step: use linear interpolation between the existing topics and
      collected sufficient statistics in `other` to update the topics.
  
      Parameters
      ----------
      rho : float
          Learning rate.
      other : :class:`~gensim.models.ldamodel.LdaModel`
          The model whose sufficient statistics will be used to update the topics.
      extra_pass : bool, optional
          Whether this step required an additional pass over the corpus.
  
      """
      logger.debug("updating topics")
      # update self with the new blend; also keep track of how much did
      # the topics change through this update, to assess convergence
      previous_Elogbeta = self.state.get_Elogbeta()
      self.state.blend(rho, other)
  
      current_Elogbeta = self.state.get_Elogbeta()
      self.sync_state(current_Elogbeta)
  
      # print out some debug info at the end of each EM iteration
      self.print_topics(5)
      diff = mean_absolute_difference(
          previous_Elogbeta.ravel(), current_Elogbeta.ravel()
      )
      logger.info("topic diff=%f, rho=%f", diff, rho)
  
      if self.optimize_eta:
          self.update_eta(self.state.get_lambda(), rho)
  
      if not extra_pass:
          # only update if this isn't an additional pass
          self.num_updates += other.numdocs
  
imports: import logging
  import numbers
  import os
  import time
  from collections import defaultdict
  import numpy
  from scipy.special import gammaln, psi
  from scipy.special import polygamma
  from gensim import interfaces, utils, matutils
  from gensim.matutils import kullback_leibler, hellinger, jaccard_distance, jensen_shannon, dirichlet_expectation, logsumexp, mean_absolute_difference
  from gensim.models import basemodel, CoherenceModel
  from gensim.models.callbacks import Callback
label_desc: Use image node_id 12 for calling the LdaModel obj's underlying member method code with example usage: obj.do_mstep(rho, other, extra_pass) without return types