class_docstr: Encapsulate information for distributed computation of :class:`~gensim.models.ldamodel.LdaModel` objects.
  
  Objects of this class are sent over the network, so try to keep them lean to
  reduce traffic.
class_docstr_tok: ["Encapsulate","information","for","distributed","computation","of",":","class",":","`","~gensim.models.ldamodel.LdaModel","`","objects",".","Objects","of","this","class","are","sent","over","the","network",",","so","try","to","keep","them","lean","to","reduce","traffic","."]
docstr: Merge the current state with another one using a weighted average for the sufficient statistics.
  
  The number of documents is stretched in both state objects, so that they are of comparable magnitude.
  This procedure corresponds to the stochastic gradient update from
  `'Online Learning for LDA' by Hoffman et al.`_, see equations (5) and (9).
  
  Parameters
  ----------
  rhot : float
      Weight of the `other` state in the computed average. A value of 0.0 means that `other`
      is completely ignored. A value of 1.0 means `self` is completely ignored.
  other : :class:`~gensim.models.ldamodel.LdaState`
      The state object with which the current one will be merged.
  targetsize : int, optional
      The number of documents to stretch both states to.
docstr_tok: ["Merge","the","current","state","with","another","one","using","a","weighted","average","for","the","sufficient","statistics",".","The","number","of","documents","is","stretched","in","both","state","objects",",","so","that","they","are","of","comparable","magnitude",".","This","procedure","corresponds","to","the","stochastic","gradient","update","from","`","'Online","Learning","for","LDA","'","by","Hoffman","et","al.","`","_",",","see","equations","(","5",")","and","(","9",")",".","Parameters","--","--","--","--","--","rhot",":","float","Weight","of","the","`","other","`","state","in","the","computed","average",".","A","value","of","0.0","means","that","`","other","`","is","completely","ignored",".","A","value","of","1.0","means","`","self","`","is","completely","ignored",".","other",":",":","class",":","`","~gensim.models.ldamodel.LdaState","`","The","state","object","with","which","the","current","one","will","be","merged",".","targetsize",":","int",",","optional","The","number","of","documents","to","stretch","both","states","to","."]
code: def blend(self, rhot, other, targetsize=None):
      """Merge the current state with another one using a weighted average for the sufficient statistics.
  
      The number of documents is stretched in both state objects, so that they are of comparable magnitude.
      This procedure corresponds to the stochastic gradient update from
      `'Online Learning for LDA' by Hoffman et al.`_, see equations (5) and (9).
  
      Parameters
      ----------
      rhot : float
          Weight of the `other` state in the computed average. A value of 0.0 means that `other`
          is completely ignored. A value of 1.0 means `self` is completely ignored.
      other : :class:`~gensim.models.ldamodel.LdaState`
          The state object with which the current one will be merged.
      targetsize : int, optional
          The number of documents to stretch both states to.
  
      """
      assert other is not None
      if targetsize is None:
          targetsize = self.numdocs
  
      # stretch the current model's expected n*phi counts to target size
      if self.numdocs == 0 or targetsize == self.numdocs:
          scale = 1.0
      else:
          scale = 1.0 * targetsize / self.numdocs
      self.sstats *= (1.0 - rhot) * scale
  
      # stretch the incoming n*phi counts to target size
      if other.numdocs == 0 or targetsize == other.numdocs:
          scale = 1.0
      else:
          logger.info(
              "merging changes from %i documents into a model of %i documents",
              other.numdocs,
              targetsize,
          )
          scale = 1.0 * targetsize / other.numdocs
      self.sstats += rhot * scale * other.sstats
  
      self.numdocs = targetsize
  
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 4 for calling the LdaState obj's underlying member method code with example usage: obj.blend(rhot, other, targetsize) without return types