class_docstr: Posterior values associated with each set of documents.
  
  TODO: use **Hoffman, Blei, Bach: Online Learning for Latent Dirichlet Allocation, NIPS 2010.**
  to update phi, gamma. End game would be to somehow replace LdaPost entirely with LdaModel.
class_docstr_tok: ["Posterior","values","associated","with","each","set","of","documents",".","TODO",":","use","*","*","Hoffman",",","Blei",",","Bach",":","Online","Learning","for","Latent","Dirichlet","Allocation",",","NIPS","2010",".","*","*","to","update","phi",",","gamma",".","End","game","would","be","to","somehow","replace","LdaPost","entirely","with","LdaModel","."]
docstr: Initialize the posterior value structure for the given LDA model.
  
  Parameters
  ----------
  doc : list of (int, int)
      A BOW representation of the document. Each element in the list is a pair of a word's ID and its number
      of occurences in the document.
  lda : :class:`~gensim.models.ldamodel.LdaModel`, optional
      The underlying LDA model.
  max_doc_len : int, optional
      The maximum number of words in a document.
  num_topics : int, optional
      Number of topics discovered by the LDA model.
  gamma : numpy.ndarray, optional
      Topic weight variational parameters for each document. If not supplied, it will be inferred from the model.
  lhood : float, optional
      The log likelihood lower bound.
docstr_tok: ["Initialize","the","posterior","value","structure","for","the","given","LDA","model",".","Parameters","--","--","--","--","--","doc",":","list","of","(","int",",","int",")","A","BOW","representation","of","the","document",".","Each","element","in","the","list","is","a","pair","of","a","word","'s","ID","and","its","number","of","occurences","in","the","document",".","lda",":",":","class",":","`","~gensim.models.ldamodel.LdaModel","`",",","optional","The","underlying","LDA","model",".","max_doc_len",":","int",",","optional","The","maximum","number","of","words","in","a","document",".","num_topics",":","int",",","optional","Number","of","topics","discovered","by","the","LDA","model",".","gamma",":","numpy.ndarray",",","optional","Topic","weight","variational","parameters","for","each","document",".","If","not","supplied",",","it","will","be","inferred","from","the","model",".","lhood",":","float",",","optional","The","log","likelihood","lower","bound","."]
code: def __init__(
      self,
      doc=None,
      lda=None,
      max_doc_len=None,
      num_topics=None,
      gamma=None,
      lhood=None,
  ):
      """Initialize the posterior value structure for the given LDA model.
  
      Parameters
      ----------
      doc : list of (int, int)
          A BOW representation of the document. Each element in the list is a pair of a word's ID and its number
          of occurences in the document.
      lda : :class:`~gensim.models.ldamodel.LdaModel`, optional
          The underlying LDA model.
      max_doc_len : int, optional
          The maximum number of words in a document.
      num_topics : int, optional
          Number of topics discovered by the LDA model.
      gamma : numpy.ndarray, optional
          Topic weight variational parameters for each document. If not supplied, it will be inferred from the model.
      lhood : float, optional
          The log likelihood lower bound.
  
      """
      self.doc = doc
      self.lda = lda
      self.gamma = gamma
      self.lhood = lhood
      if self.gamma is None:
          self.gamma = np.zeros(num_topics)
      if self.lhood is None:
          self.lhood = np.zeros(num_topics + 1)
  
      if max_doc_len is not None and num_topics is not None:
          self.phi = np.zeros((max_doc_len, num_topics))
          self.log_phi = np.zeros((max_doc_len, num_topics))
  
      # the following are class variables which are to be integrated during Document Influence Model
  
      self.doc_weight = None
      self.renormalized_doc_weight = None
  
imports: import logging
  import numpy
  from scipy.special import digamma, gammaln
  from scipy import optimize
  from gensim import utils, matutils
  from gensim.models import ldamodel
label_desc: Use image node_id 1 to create a new LdaPost object from inherited base classes: utils with example: obj = LdaPost(doc, lda, max_doc_len, num_topics, gamma, lhood)