class_docstr: LDA model that works with a HeteroGraph with doc->word meta paths.
  The model alters the attributes of G arbitrarily.
  This is inspired by [1] and its corresponding scikit-learn implementation.
  
  Inputs
  ---
  * G: a template graph or an integer showing n_words
  * n_components: latent feature dimension; automatically set priors if missing.
  * prior: parameters in the Dirichlet prior; default to 1/n_components and 1/n_words
  * rho: new_nphi = (1-rho)*old_nphi + rho*nphi; default to 1 for full gradients.
  * mult: multiplier for nphi-update; a large value effectively disables prior.
  * init: sklearn initializers (100.0, 100.0); the sample points concentrate around 1.0
  * device_list: accelerate word_data updates.
  
  Notes
  ---
  Some differences between this and sklearn.decomposition.LatentDirichletAllocation:
  * default word perplexity is normalized by training set instead of testing set.
  
  References
  ---
  [1] Matthew Hoffman, Francis Bach, David Blei. Online Learning for Latent
  Dirichlet Allocation. Advances in Neural Information Processing Systems 23
  (NIPS 2010).
  [2] Reactive LDA Library blogpost by Yingjie Miao for a similar Gibbs model
class_docstr_tok: ["LDA","model","that","works","with","a","HeteroGraph","with","doc-",">","word","meta","paths",".","The","model","alters","the","attributes","of","G","arbitrarily",".","This","is","inspired","by","[","1","]","and","its","corresponding","scikit-learn","implementation",".","Inputs","--","-","*","G",":","a","template","graph","or","an","integer","showing","n_words","*","n_components",":","latent","feature","dimension",";","automatically","set","priors","if","missing",".","*","prior",":","parameters","in","the","Dirichlet","prior",";","default","to","1\/n_components","and","1\/n_words","*","rho",":","new_nphi","=","(","1-rho",")","*","old_nphi","+","rho","*","nphi",";","default","to","1","for","full","gradients",".","*","mult",":","multiplier","for","nphi-update",";","a","large","value","effectively","disables","prior",".","*","init",":","sklearn","initializers","(","100.0",",","100.0",")",";","the","sample","points","concentrate","around","1.0","*","device_list",":","accelerate","word_data","updates",".","Notes","--","-","Some","differences","between","this","and","sklearn.decomposition.LatentDirichletAllocation",":","*","default","word","perplexity","is","normalized","by","training","set","instead","of","testing","set",".","References","--","-","[","1","]","Matthew","Hoffman",",","Francis","Bach",",","David","Blei",".","Online","Learning","for","Latent","Dirichlet","Allocation",".","Advances","in","Neural","Information","Processing","Systems","23","(","NIPS","2010",")",".","[","2","]","Reactive","LDA","Library","blogpost","by","Yingjie","Miao","for","a","similar","Gibbs","model"]
code: def _init_doc_data(self, n_docs, device):
      doc_nphi = Gamma(*self.init["doc"]).sample(
          (n_docs, self.n_components), device
      )
      return DocData(self.prior["doc"], doc_nphi)
  
imports: import collections
  import functools
  import io
  import os
  import warnings
  import dgl
  import numpy
  import scipy
  import torch
label_desc: Use image node_id 3 for calling the LatentDirichletAllocation obj's underlying member method code with example usage: obj._init_doc_data(n_docs, device) and returns: DocData