ObservationType - Type of Observations handled by the HMM.@PublicationReference(author="William Turin", title="Unidirectional and Parallel Baum\u2013Welch Algorithms", type=Journal, publication="IEEE Transactions on Speech and Audio Processing", year=1998, url="http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=00725318") public class ParallelHiddenMarkovModel<ObservationType> extends HiddenMarkovModel<ObservationType> implements ParallelAlgorithm
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ParallelHiddenMarkovModel.ComputeTransitionsTask
Calls the computeTransitions method.
|
protected class |
ParallelHiddenMarkovModel.LogLikelihoodTask
Computes the log-likelihood of a particular data sequence
|
protected static class |
ParallelHiddenMarkovModel.NormalizeTransitionTask
Calls the normalizeTransitionMatrix method.
|
protected static class |
ParallelHiddenMarkovModel.ObservationLikelihoodTask<ObservationType>
Calls the computeObservationLikelihoods() method.
|
protected static class |
ParallelHiddenMarkovModel.StateObservationLikelihoodTask
Calls the computeStateObservationLikelihood() method.
|
protected class |
ParallelHiddenMarkovModel.ViterbiTask
Computes the most-likely "from state" for the given "destination state"
and the given deltas.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.util.ArrayList<ParallelHiddenMarkovModel.ComputeTransitionsTask> |
computeTransitionTasks
ComputeTransitionsTasks.
|
protected java.util.ArrayList<ParallelHiddenMarkovModel.NormalizeTransitionTask> |
normalizeTransitionTasks
NormalizeTransitionTasks.
|
protected java.util.ArrayList<ParallelHiddenMarkovModel.ObservationLikelihoodTask<ObservationType>> |
observationLikelihoodTasks
Observation likelihood tasks
|
protected java.util.ArrayList<ParallelHiddenMarkovModel.StateObservationLikelihoodTask> |
stateObservationLikelihoodTasks
StateObservationLikelihoodTasks
|
protected java.util.ArrayList<ParallelHiddenMarkovModel.ViterbiTask> |
viterbiTasks
Viterbi tasks.
|
emissionFunctionsDEFAULT_NUM_STATES, initialProbability, transitionProbability| Constructor and Description |
|---|
ParallelHiddenMarkovModel()
Creates a new instance of ParallelHiddenMarkovModel
|
ParallelHiddenMarkovModel(HiddenMarkovModel<ObservationType> other)
\
Creates a new
ParallelHiddenMarkovModel from another
HiddenMarkovModel. |
ParallelHiddenMarkovModel(int numStates)
Creates a new instance of ParallelHiddenMarkovModel
|
ParallelHiddenMarkovModel(Vector initialProbability,
Matrix transitionProbability,
java.util.Collection<? extends ComputableDistribution<ObservationType>> emissionFunctions)
Creates a new instance of ParallelHiddenMarkovModel
|
| Modifier and Type | Method and Description |
|---|---|
double |
computeMultipleObservationLogLikelihood(java.util.Collection<? extends java.util.Collection<? extends ObservationType>> sequences)
Computes the log-likelihood of the observation sequences, given the
current HMM's parameterization.
|
protected java.util.ArrayList<Vector> |
computeStateObservationLikelihood(java.util.ArrayList<WeightedValue<Vector>> alphas,
java.util.ArrayList<WeightedValue<Vector>> betas,
double scaleFactor)
Computes the probabilities of the various states over time given the
observation sequence.
|
protected Matrix |
computeTransitions(java.util.ArrayList<WeightedValue<Vector>> alphas,
java.util.ArrayList<WeightedValue<Vector>> betas,
java.util.ArrayList<Vector> b)
Computes the stochastic transition-probability matrix from the
given probabilities.
|
protected Pair<Vector,int[]> |
computeViterbiRecursion(Vector delta,
Vector bn)
Computes the Viterbi recursion for a given "delta" and "b"
|
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.
|
protected void |
normalizeTransitionMatrix(Matrix A)
Normalizes the transition-probability matrix
|
void |
setThreadPool(java.util.concurrent.ThreadPoolExecutor threadPool)
Sets the thread pool for the algorithm to use.
|
clone, computeBackwardProbabilities, computeBackwardProbabilities, computeForwardProbabilities, computeForwardProbabilities, computeObservationLikelihoods, computeObservationLikelihoods, computeObservationLikelihoods, computeObservationLogLikelihood, computeObservationLogLikelihood, computeStateObservationLikelihood, computeTransitions, createRandom, createRandom, createRandom, findMostLikelyState, getEmissionFunctions, sample, sample, sampleInto, setEmissionFunctions, stateBeliefs, toString, viterbicreateUniformInitialProbability, createUniformTransitionProbability, getFutureStateDistribution, getInitialProbability, getNumStates, getSteadyStateDistribution, getTransitionProbability, normalize, normalizeTransitionMatrix, setInitialProbability, setTransitionProbabilityequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcloneprotected transient java.util.ArrayList<ParallelHiddenMarkovModel.ObservationLikelihoodTask<ObservationType>> observationLikelihoodTasks
protected transient java.util.ArrayList<ParallelHiddenMarkovModel.ComputeTransitionsTask> computeTransitionTasks
protected transient java.util.ArrayList<ParallelHiddenMarkovModel.NormalizeTransitionTask> normalizeTransitionTasks
protected transient java.util.ArrayList<ParallelHiddenMarkovModel.StateObservationLikelihoodTask> stateObservationLikelihoodTasks
protected transient java.util.ArrayList<ParallelHiddenMarkovModel.ViterbiTask> viterbiTasks
public ParallelHiddenMarkovModel()
public ParallelHiddenMarkovModel(int numStates)
numStates - Number of states in the HMM.public ParallelHiddenMarkovModel(Vector initialProbability, Matrix transitionProbability, java.util.Collection<? extends ComputableDistribution<ObservationType>> emissionFunctions)
initialProbability - Initial probability Vector over the states. Each entry must be
nonnegative and the Vector must sum to 1.transitionProbability - Transition probability matrix. The entry (i,j) is the probability
of transition from state "j" to state "i". As a corollary, all
entries in the Matrix must be nonnegative and the
columns of the Matrix must sum to 1.emissionFunctions - The PDFs that emit symbols from each state.public ParallelHiddenMarkovModel(HiddenMarkovModel<ObservationType> other)
ParallelHiddenMarkovModel from another
HiddenMarkovModel.other - The other hidden Markov model to copy.public 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 ParallelAlgorithmpublic double computeMultipleObservationLogLikelihood(java.util.Collection<? extends java.util.Collection<? extends ObservationType>> sequences)
HiddenMarkovModelcomputeMultipleObservationLogLikelihood in class HiddenMarkovModel<ObservationType>sequences - Observations sequences to considerprotected Matrix computeTransitions(java.util.ArrayList<WeightedValue<Vector>> alphas, java.util.ArrayList<WeightedValue<Vector>> betas, java.util.ArrayList<Vector> b)
HiddenMarkovModelcomputeTransitions in class HiddenMarkovModel<ObservationType>alphas - Result of the forward pass through the HMM.betas - Result of the backward pass through the HMM.b - Conditionally independent likelihoods of each observation.protected void normalizeTransitionMatrix(Matrix A)
MarkovChainnormalizeTransitionMatrix in class MarkovChainA - Transition probability matrix to normalize, modified by side effectprotected java.util.ArrayList<Vector> computeStateObservationLikelihood(java.util.ArrayList<WeightedValue<Vector>> alphas, java.util.ArrayList<WeightedValue<Vector>> betas, double scaleFactor)
HiddenMarkovModelcomputeStateObservationLikelihood in class HiddenMarkovModel<ObservationType>alphas - Forward probabilities.betas - Backward probabilities.scaleFactor - Amount to scale the gamma byprotected Pair<Vector,int[]> computeViterbiRecursion(Vector delta, Vector bn)
HiddenMarkovModelcomputeViterbiRecursion in class HiddenMarkovModel<ObservationType>delta - Previous value of the Viterbi recursion.bn - Current observation likelihood.