@Override protected void initialize_probability(Collection<_Doc> collection) { int cores = Runtime.getRuntime().availableProcessors(); m_threadpool = new Thread[cores]; m_workers = new LRHTSM_worker[cores]; for (int i = 0; i < cores; i++) m_workers[i] = new LRHTSM_worker(number_of_topics, vocabulary_size, m_corpus.getLargestSentenceSize()); int workerID = 0; for (_Doc d : collection) { m_workers[workerID % cores].addDoc(d); workerID++; } super.initialize_probability(collection); }
@Override protected void init() { // clear up for next iteration super.init(); for (TopicModelWorker worker : m_workers) worker.resetStats(); }