public class ParallelLatentDirichletAllocationVectorGibbsSampler extends LatentDirichletAllocationVectorGibbsSampler implements ParallelAlgorithm
LatentDirichletAllocationVectorGibbsSampler.
It runs the sampling for the different documents using a thread pool.| Modifier and Type | Class and Description |
|---|---|
protected class |
ParallelLatentDirichletAllocationVectorGibbsSampler.DocumentSampleTask
A document sampling task
|
LatentDirichletAllocationVectorGibbsSampler.Resultalpha, beta, burnInIterations, DEFAULT_ALPHA, DEFAULT_BETA, DEFAULT_BURN_IN_ITERATIONS, DEFAULT_ITERATIONS_PER_SAMPLE, DEFAULT_MAX_ITERATIONS, DEFAULT_TOPIC_COUNT, documentCount, documentTermCounts, documentTermPairsCounts, documentTerms, documentTopicCount, documentTopicSum, iterationsPerSample, occurrenceTopicAssignments, random, result, sampleCount, termCount, topicCount, topicCumulativeProportions, topicTermCount, topicTermSumdata, keepGoingmaxIterationsDEFAULT_ITERATION, iteration| Constructor and Description |
|---|
ParallelLatentDirichletAllocationVectorGibbsSampler()
Creates a new
ParallelLatentDirichletAllocationVectorGibbsSampler with
default parameters. |
ParallelLatentDirichletAllocationVectorGibbsSampler(int topicCount,
double alpha,
double beta,
int maxIterations,
int burnInIterations,
int iterationsPerSample,
java.util.Random random)
Creates a new
ParallelLatentDirichletAllocationVectorGibbsSampler with
the given parameters. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanupAlgorithm()
Called to clean up the learning algorithm's state after learning has
finished.
|
int |
getNumThreads()
Gets the number of threads in the thread pool.
|
java.util.concurrent.ThreadPoolExecutor |
getThreadPool()
Gets the thread pool for the algorithm to use.
|
void |
setThreadPool(java.util.concurrent.ThreadPoolExecutor threadPool)
Sets the thread pool for the algorithm to use.
|
protected boolean |
step()
Called to take a single step of the learning algorithm.
|
getAlpha, getBeta, getBurnInIterations, getDocumentCount, getIterationsPerSample, getRandom, getResult, getTermCount, getTopicCount, initializeAlgorithm, readParameters, sampleTopic, setAlpha, setBeta, setBurnInIterations, setIterationsPerSample, setRandom, setTopicCountclone, getData, getKeepGoing, learn, setData, setKeepGoing, stopgetMaxIterations, isResultValid, setMaxIterationsaddIterativeAlgorithmListener, fireAlgorithmEnded, fireAlgorithmStarted, fireStepEnded, fireStepStarted, getIteration, getListeners, removeIterativeAlgorithmListener, setIteration, setListenersequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclonegetMaxIterations, setMaxIterationsaddIterativeAlgorithmListener, getIteration, removeIterativeAlgorithmListenerisResultValidpublic ParallelLatentDirichletAllocationVectorGibbsSampler()
ParallelLatentDirichletAllocationVectorGibbsSampler with
default parameters.public ParallelLatentDirichletAllocationVectorGibbsSampler(int topicCount,
double alpha,
double beta,
int maxIterations,
int burnInIterations,
int iterationsPerSample,
java.util.Random random)
ParallelLatentDirichletAllocationVectorGibbsSampler with
the given parameters.topicCount - The number of topics for the algorithm to create. Must be positive.alpha - The alpha parameter controlling the Dirichlet distribution for the
document-topic probabilities. It acts as a prior weight assigned to
the document-topic counts. Must be positive.beta - The beta parameter controlling the Dirichlet distribution for the
topic-term probabilities. It acts as a prior weight assigned to
the topic-term counts.maxIterations - The maximum number of iterations to run for. Must be positive.burnInIterations - The number of burn-in iterations for the Markov Chain Monte Carlo
algorithm to run before sampling begins.iterationsPerSample - The number of iterations to the Markov Chain Monte Carlo algorithm
between samples (after the burn-in iterations).random - The random number generator to use.protected boolean step()
AbstractAnytimeBatchLearnerstep in class LatentDirichletAllocationVectorGibbsSamplerprotected void cleanupAlgorithm()
AbstractAnytimeBatchLearnercleanupAlgorithm in class LatentDirichletAllocationVectorGibbsSamplerpublic java.util.concurrent.ThreadPoolExecutor getThreadPool()
ParallelAlgorithmgetThreadPool in interface ParallelAlgorithmpublic void setThreadPool(java.util.concurrent.ThreadPoolExecutor threadPool)
ParallelAlgorithmsetThreadPool in interface ParallelAlgorithmthreadPool - Thread pool used for parallelization.public int getNumThreads()
ParallelAlgorithmgetNumThreads in interface ParallelAlgorithm