@Override protected void cleanup(Context context) { getModelTrainer().stop(); } }
@Override public Double call() { run(); return readModel.perplexity(document, docTopics); } }
public TopicModel(Matrix topicTermCounts, double eta, double alpha, String[] dictionary, int numThreads, double modelWeight) { this(topicTermCounts, viewRowSums(topicTermCounts), eta, alpha, dictionary, numThreads, modelWeight); }
@Override public void run() { for (int i = 0; i < numDocTopicIters; i++) { // synchronous read-only call: readModel.trainDocTopicModel(document, docTopics, docTopicModel); } if (writeModel != null) { // parallel call which is read-only on the docTopicModel, and write-only on the writeModel // this method does not return until all rows of the docTopicModel have been submitted // to write work queues writeModel.update(docTopicModel); } }
public double iterateUntilConvergence(double minFractionalErrorChange, int maxIterations, int minIter) { return iterateUntilConvergence(minFractionalErrorChange, maxIterations, minIter, 0); }
public TopicModel(Configuration conf, double eta, double alpha, String[] dictionary, int numThreads, double modelWeight, Path... modelpath) throws IOException { this(loadModel(conf, modelpath), eta, alpha, dictionary, numThreads, modelWeight); }
public void trainDocuments() { trainDocuments(0); }
public TopicModel(int numTopics, int numTerms, double eta, double alpha, Random random, String[] dictionary, int numThreads, double modelWeight) { this(randomMatrix(numTopics, numTerms, random), eta, alpha, dictionary, numThreads, modelWeight); }
public void persist(Path outputPath) throws IOException { readModel.persist(outputPath, true); }
public double calculatePerplexity(VectorIterable matrix, VectorIterable docTopicCounts) { return calculatePerplexity(matrix, docTopicCounts, 0); }
public void writeModel(Path outputPath) throws IOException { modelTrainer.persist(outputPath); }
@Override protected void cleanup(Context context) { getModelTrainer().stop(); } }
@Override public Double call() { run(); return readModel.perplexity(document, docTopics); } }
public TopicModel(Matrix topicTermCounts, double eta, double alpha, String[] dictionary, int numThreads, double modelWeight) { this(topicTermCounts, viewRowSums(topicTermCounts), eta, alpha, dictionary, numThreads, modelWeight); }
public TopicModel(Configuration conf, double eta, double alpha, String[] dictionary, int numThreads, double modelWeight, Path... modelpath) throws IOException { this(loadModel(conf, modelpath), eta, alpha, dictionary, numThreads, modelWeight); }
public void trainDocuments() { trainDocuments(0); }
@Override protected void cleanup(Context context) { getModelTrainer().stop(); } }
@Override public Double call() { run(); return readModel.perplexity(document, docTopics); } }
public TopicModel(Matrix topicTermCounts, double eta, double alpha, String[] dictionary, int numThreads, double modelWeight) { this(topicTermCounts, viewRowSums(topicTermCounts), eta, alpha, dictionary, numThreads, modelWeight); }