kzhai / pylda Goto Github PK
View Code? Open in Web Editor NEWA Latent Dirichlet Allocation implementation in Python.
A Latent Dirichlet Allocation implementation in Python.
I have to add some regularizer term to the likelihood equation containing beta terms. I am unable to figure out from the code which part of the code does the M-step update for the conditional multinomial parameter beta
In LDA's slice sampling code:
Line 118: r_log_alpha_alpha = old_log_alpha_alpha + hyper_parameter_step;
Should it be:
r_log_alpha_alpha = l_log_alpha_beta + hyper_parameter_step?
(Similar issue with beta as well)
On http://projecteuclid.org/download/pdf_1/euclid.aos/1056562461's page 715:
L = x0 - w * U
R = L + w
Hi @kzhai ,
it's a nice work.
when i am reading you code , i find that the iteration of phi is a little different from the iteration formular:
where is a "lambda" rather then a "eta" in you code,
log_phi = E_log_eta[:, term_ids].T + numpy.tile(scipy.special.psi(gamma_values[[doc_id], :]), (word_ids[doc_id].shape[0], 1));
to make it run example , we sould:
1.use --training_iterations , not ----number_of_iterations
2.express the ap.tar.gz and copy the file to root like:
ubgpu@ubgpu:~/github/PyLDA$ tree
.
├── doc.dat
├── input
│ ├── ap
│ └── ap.tar.gz
├── output
├── raw
│ └── ap.tar.gz
├── README.md
├── src
│ └── lda
│ ├── hybrid.py
│ ├── inferencer.py
│ ├── init.py
│ ├── init.pyc
│ ├── launch_test.py
│ ├── launch_train.py
│ ├── monte_carlo.py
│ └── variational_bayes.py
├── test.dat
├── train.dat
└── voc.dat
6 directories, 15 files
ubgpu@ubgpu:/github/PyLDA$ cd src//github/PyLDA/src$ python -m lda.launch_train --input_directory=../ input/ap --output_directory=../output/ --number_of_topics=10 --training_iterations=100 --inference_mode=0
ubgpu@ubgpu:
successfully load all training docs from /home/ubgpu/github/PyLDA/train.dat...
successfully load all the words from /home/ubgpu/github/PyLDA/voc.dat...
========== ========== ========== ========== ==========
output_directory=../output/../150730-225540-lda-I100-S10-K10-aa0.100000-ab0.000147-im0/
input_directory=..
corpus_name=..
training_iterations=100
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.