【发布时间】:2018-01-03 16:46:00
【问题描述】:
我目前正在使用 ParallelTopicModel 进行主题建模,但我遇到了一些奇怪的行为。当我为模型设置不同数量的线程时,我会得到不同的结果,如果我是对的,这不应该发生。我们编写的实现在具有不同最大线程数的不同机器上使用,但不知何故结果是不同的。 随机种子、文档、迭代等都是一样的。
这是一个已知的错误还是预期的?还是我只是做错了什么?
代码片段:
// Begin by importing documents from text to feature sequences
final InstanceList instances = new InstanceList(docPipe);
instances.addThruPipe(docsIter);
final ParallelTopicModel model =
new ParallelTopicModel(noOfTopics, m_alpha.getDoubleValue() * noOfTopics, m_beta.getDoubleValue());
model.setRandomSeed(m_seed.getIntValue());
model.addInstances(instances);
model.setNumThreads(noOfThreads);
model.setNumIterations(noOfIterations);
try {
model.estimate();
} catch (RuntimeException e) {
throw e;
}
【问题讨论】:
标签: topic-modeling mallet