Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Commit

Permalink
Fixes doc-topic persistence if no prior are given on either the model…
Browse files Browse the repository at this point in the history
… or the documents (by doing the usual thing of taking a randomized model to start)
  • Loading branch information
jakemannix committed Dec 21, 2012
1 parent 0d82f26 commit 0ae8d27
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -25,6 +25,7 @@
import org.apache.hadoop.mapred.Reporter;
import org.apache.hadoop.mapred.lib.MultipleOutputs;
import org.apache.hadoop.mapreduce.Counter;
import org.apache.mahout.common.RandomUtils;
import org.apache.mahout.math.DenseMatrix;
import org.apache.mahout.math.DenseVector;
import org.apache.mahout.math.Matrix;
Expand Down Expand Up @@ -96,8 +97,9 @@ public void configure(JobConf conf) {
log.info("No model files found, starting with uniform p(term|topic) prior");
Matrix m = new DenseMatrix(numTopics, numTerms);
m.assign(1.0 / numTerms);
readModel = new TopicModel(m, new DenseVector(numTopics).assign(1.0), eta, alpha, null,
numTrainThreads, modelWeight);
readModel = new TopicModel(numTopics, numTerms, eta, alpha,
RandomUtils.getRandom(c.getRandomSeed()), null,
numTrainThreads, modelWeight);
}

log.info("Initializing write model");
Expand Down

0 comments on commit 0ae8d27

Please sign in to comment.