lib/lda-inference.c in ealdent-lda-ruby-0.1.4 vs lib/lda-inference.c in ealdent-lda-ruby-0.1.5
- old
+ new
@@ -467,10 +467,24 @@
lda_suffstats* ss = NULL;
if (strcmp(start, "seeded")==0) {
model = new_lda_model(corpus->num_terms, NTOPICS);
ss = new_lda_suffstats(model);
- corpus_initialize_ss(ss, model, corpus);
+ if (VERBOSE) {
+ corpus_initialize_ss(ss, model, corpus);
+ } else {
+ quiet_corpus_initialize_ss(ss, model, corpus);
+ }
+ if (VERBOSE) {
+ lda_mle(model, ss, 0);
+ } else {
+ quiet_lda_mle(model, ss, 0);
+ }
+ model->alpha = INITIAL_ALPHA;
+ } else if (strcmp(start, "fixed")==0) {
+ model = new_lda_model(corpus->num_terms, NTOPICS);
+ ss = new_lda_suffstats(model);
+ corpus_initialize_fixed_ss(ss, model, corpus);
if (VERBOSE) {
lda_mle(model, ss, 0);
} else {
quiet_lda_mle(model, ss, 0);
}
\ No newline at end of file