[WIP] HDP#1055
Conversation
|
@tmylk , only python 2.6 has failed with |
|
That test error will be fixed after #1056 merged in |
| return(sp.psi(alpha) - sp.psi(np.sum(alpha, 1))[:, np.newaxis]) | ||
|
|
||
|
|
||
| def get_random_state(seed): |
There was a problem hiding this comment.
why copy-paste from LdaModel? Should it be moved to utils?
There was a problem hiding this comment.
I'll move the common ldamodel and hdpmodel methods to the respective utils and matutils files after this PR is merged.
There was a problem hiding this comment.
Need to make a few other changes to utils and matutils as well
There was a problem hiding this comment.
This should be done as a part of this PR. Duplicate code will not be merged.
|
@tmylk tests pass! |
|
@tmylk what else would you want done on this PR? |
| return(sp.psi(alpha) - sp.psi(np.sum(alpha, 1))[:, np.newaxis]) | ||
|
|
||
|
|
||
| def get_random_state(seed): |
There was a problem hiding this comment.
This should be done as a part of this PR. Duplicate code will not be merged.
| def suggested_lda_model(self): | ||
| """ | ||
| Returns closest corresponding ldamodel object corresponding to current hdp model. | ||
| The num_topics is m_T (default is 150) so as to preserve the matrice shapes when we assign alpha and beta. |
There was a problem hiding this comment.
how is it different from hdp_to_lda? Add a comment
There was a problem hiding this comment.
Removed duplicate code, added comment.
|
I've moved the |
|
@tmylk I've addressed all your comments. |
|
Thanks for the PR! |
| return numpy.random.RandomState(seed) | ||
| if isinstance(seed, numpy.random.RandomState): | ||
| return seed | ||
| raise ValueError('%r cannot be used to seed a numpy.random.RandomState' |
There was a problem hiding this comment.
No vertical indent in gensim, please use hanging indent.
@tmylk this keeps happening over and over -- watch out for this in reviews.
There was a problem hiding this comment.
My bad, I had just copy-pasted this from the existing ldamodel code and missed this. Fixing it in a new PR where I make some changes to utils.
* Added print methods, lda_model * Added HDP tests * Changelog * Removed duplicate code * Removed duplicate code * Added import * Fixed Changelog
This is to address issues #901, and #952, and go towards fixing #945 - basically to attempt to clean up HDP as much as possible.
This includes only the HDP changes from the closed #996.
I'll make the other cosmetic changes, and moving the appropriate methods to
utilsandmatutilsin a different PR.