Closed yota2013 closed 7 years ago
hi @yota2013 | thanks for sharing! My guess is that the black box method in KLqp
will not work for LDA, for both combinatorial discrete reasons and also difficulty in handling inference with Dirichlet variational approximations. For LDA to work, we'll need more traditional model-specific methods which leverage coordinate ascent updates via exponential families.
Alternatively, you can try Normal variational approximations, transformed to lie on the simplex using TransformedDistribution
. I know some people have had some success with reparameterized normal approximations + inference networks. But I think it's a fragile solution. Clearly it warrants model-specific methods (which Edward is all about, in principle!).
Closing as it's a user-implementation issue. See the Forum's thread for more details (https://discourse.edwardlib.org/t/confused-by-error-message-from-inference-run-for-lda-with-klqp/119); also see duplicates in #423, #473, #463.
Is it possible to use Gibbs sampling to deal with this problem?
Thank you for sharing this implementation! I have a clarification to ask.
When presenting the w_train data as a np.array, does each number in a column represent the frequency of word corresponding to that column's index? Or does it represent at that location, in the document a word appear?
Thank you very much!
We implemented LDA. But it does not work well. Please let me know if there is something wrong. Thank you.