ObservationType
- Type of observations handled by the algorithmpublic class ParallelDirichletProcessMixtureModel<ObservationType> extends DirichletProcessMixtureModel<ObservationType> implements ParallelAlgorithm
Modifier and Type | Class and Description |
---|---|
protected class |
ParallelDirichletProcessMixtureModel.ClusterUpdaterTask
Tasks that update the values of the clusters for Gibbs sampling
|
static class |
ParallelDirichletProcessMixtureModel.DPMMAssignments
Assignments from the DPMM
|
protected class |
ParallelDirichletProcessMixtureModel.ObservationAssignmentTask
Task that assign observations to cluster indices
|
DirichletProcessMixtureModel.DPMMCluster<ObservationType>, DirichletProcessMixtureModel.DPMMLogConditional, DirichletProcessMixtureModel.MultivariateMeanCovarianceUpdater, DirichletProcessMixtureModel.MultivariateMeanUpdater, DirichletProcessMixtureModel.Sample<ObservationType>, DirichletProcessMixtureModel.Updater<ObservationType>
Modifier and Type | Field and Description |
---|---|
protected java.util.ArrayList<ParallelDirichletProcessMixtureModel.ObservationAssignmentTask> |
assignmentTasks
Tasks that assign observations to clusters
|
protected java.util.ArrayList<ParallelDirichletProcessMixtureModel.ClusterUpdaterTask> |
clusterUpdaterTasks
Tasks that update the values of the clusters for Gibbs sampling
|
alphaInverseSampler, clusterWeights, conditionalPriorPredictive, DEFAULT_ALPHA, DEFAULT_NUM_INITIAL_CLUSTERS, DEFAULT_REESTIMATE_ALPHA, etaSampler, initialAlpha, reestimateAlpha, updater
currentParameter, DEFAULT_NUM_SAMPLES, previousParameter, random
data, keepGoing
maxIterations
DEFAULT_ITERATION, iteration
Constructor and Description |
---|
ParallelDirichletProcessMixtureModel()
Creates a new instance of ParallelDirichletProcessMixtureModel
|
Modifier and Type | Method and Description |
---|---|
protected java.util.ArrayList<java.util.Collection<ObservationType>> |
assignObservationsToClusters(int K,
DirichletProcessMixtureModel.DPMMLogConditional logConditional)
Assigns observations to each of the K clusters,
plus the as-yet-uncreated new cluster
|
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 java.util.ArrayList<DirichletProcessMixtureModel.DPMMCluster<ObservationType>> |
updateClusters(java.util.ArrayList<java.util.Collection<ObservationType>> clusterAssignments)
Update each cluster according to the data assigned to it
|
assignObservationToCluster, clone, createCluster, createInitialLearnedObject, getInitialAlpha, getNumInitialClusters, getReestimateAlpha, getUpdater, mcmcUpdate, setInitialAlpha, setNumInitialClusters, setReestimateAlpha, setUpdater, updateAlpha
cleanupAlgorithm, getBurnInIterations, getCurrentParameter, getIterationsPerSample, getPreviousParameter, getRandom, getResult, initializeAlgorithm, setBurnInIterations, setCurrentParameter, setIterationsPerSample, setRandom, setResult, step
getData, getKeepGoing, learn, setData, setKeepGoing, stop
getMaxIterations, isResultValid, setMaxIterations
addIterativeAlgorithmListener, fireAlgorithmEnded, fireAlgorithmStarted, fireStepEnded, fireStepStarted, getIteration, getListeners, removeIterativeAlgorithmListener, setIteration, setListeners
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone
learn
getMaxIterations, setMaxIterations
addIterativeAlgorithmListener, getIteration, removeIterativeAlgorithmListener
isResultValid, stop
protected transient java.util.ArrayList<ParallelDirichletProcessMixtureModel.ObservationAssignmentTask> assignmentTasks
protected transient java.util.ArrayList<ParallelDirichletProcessMixtureModel.ClusterUpdaterTask> clusterUpdaterTasks
public ParallelDirichletProcessMixtureModel()
public int getNumThreads()
ParallelAlgorithm
getNumThreads
in interface ParallelAlgorithm
public java.util.concurrent.ThreadPoolExecutor getThreadPool()
ParallelAlgorithm
getThreadPool
in interface ParallelAlgorithm
public void setThreadPool(java.util.concurrent.ThreadPoolExecutor threadPool)
ParallelAlgorithm
setThreadPool
in interface ParallelAlgorithm
threadPool
- Thread pool used for parallelization.protected java.util.ArrayList<java.util.Collection<ObservationType>> assignObservationsToClusters(int K, DirichletProcessMixtureModel.DPMMLogConditional logConditional)
DirichletProcessMixtureModel
assignObservationsToClusters
in class DirichletProcessMixtureModel<ObservationType>
K
- Number of clusterslogConditional
- The log of the conditional.protected java.util.ArrayList<DirichletProcessMixtureModel.DPMMCluster<ObservationType>> updateClusters(java.util.ArrayList<java.util.Collection<ObservationType>> clusterAssignments)
DirichletProcessMixtureModel
updateClusters
in class DirichletProcessMixtureModel<ObservationType>
clusterAssignments
- Observations assigned to each cluster