lda icon indicating copy to clipboard operation
lda copied to clipboard

Can't run usage/dev.py

Open wong2 opened this issue 12 years ago • 3 comments

Hi, I removed the comment before corpus.lda(100, 30, 2.5, 0.1) in usage/dev.py, then run it, and I got this error:

Traceback (most recent call last):
  File "dev.py", line 19, in <module>
    corpus.lda(100, 30, 2.5, 0.1)
  File "/home/wong2/codes/bi/lda/lda.py", line 145, in lda
    new_topic_index = np.random.multinomial(1, np.random.dirichlet(topic_distribution)).argmax()
  File "mtrand.pyx", line 4216, in mtrand.RandomState.dirichlet (numpy/random/mtrand/mtrand.c:17783)
ZeroDivisionError: float division

wong2 avatar May 05 '12 11:05 wong2

To @wong2 : You may go to see my forked repo: https://github.com/hitalex/lda-with-gibbs I have done some corrections.

hitalex avatar Sep 11 '12 02:09 hitalex

@hitalex Thanks, though I no longer need to play with LDA.

wong2 avatar Sep 11 '12 13:09 wong2

It is just a toy example of Gibbs sampling after all.

On Tue, Sep 11, 2012 at 9:01 PM, Wang Dàpéng [email protected]:

@hitalex https://github.com/hitalex Thanks, though I no longer need to play with LDA.

— Reply to this email directly or view it on GitHubhttps://github.com/davidmcclure/lda/issues/1#issuecomment-8458683.

Qingchao Kong (孔庆超)

Ph.D. Candidate Institute of Automation, Chinese Academy of Sciences

No. 95 Zhongguancun East Road Haidian District, Beijing 100190 China

hitalex avatar Sep 11 '12 13:09 hitalex