public abstract class ObservationClassifier extends TypedAtomicActor
This actor performs Maximum-Likelihood classification of the partially-observed Bayesian Network models. ClassifyObservations is designed to work with ExpectationMaximization, which provides the Maximum-Likelihood model parameters from which the observations are assumed to be drawn. The output is an integer array of labels, representing the maximum-likelihood hidden state sequence of the given model.
The user provides a set of parameter estimates as inputs to the model, and The mean is a double array input containing the mean estimate and sigma is a double array input containing standard deviation estimate of each mixture component. If the modelType is HMM, then an additional input, transitionMatrix is provided, which is an estimate of the transition matrix governing the Markovian process representing the hidden state evolution. The prior input is an estimate of the prior state distribution.
References
[1] Jordan, Michael I., et al. An introduction to variational methods for graphical models, Springer Netherlands, 1998.
[2] Bilmes, Jeff A. A gentle tutorial of the EM algorithm and its application to parameter estimation for Gaussian mixture and hidden Markov models. International Computer Science Institute 4.510 (1998): 126.
ParameterEstimator
,
HMMGaussianClassifier
,
HMMMultinomialClassifier
Red (ilgea) |
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected int |
_classificationLength
length of the observation array to be classified.
|
protected double |
_likelihood
sequence likelihood assigned to current input.
|
protected int |
_nStates
number of hidden states.
|
protected double[] |
_observations
observation array.
|
protected double[] |
_priors
prior hidden state distribution.
|
protected double[][] |
_transitionMatrixEstimate
transition matrix estimate for the markov chain model.
|
TypedIOPort |
input
An array of input symbols to be classified.
|
TypedIOPort |
likelihood
Likelihood of the input stream given the parameterized HMM.
|
TypedIOPort |
output
An array of state labels assigned to input symbols.
|
PortParameter |
prior
An array that defines priors on initial states.
|
PortParameter |
transitionMatrix
The transition probability matrix of the hidden markov chain.
|
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
ObservationClassifier(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
Modifier and Type | Method and Description |
---|---|
protected int[] |
classifyHMM(double[] y,
double[] prior,
double[][] A)
Alpha-beta recursion
|
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace.
|
protected abstract double |
emissionProbability(double y,
int hiddenState)
Abstract class defining the emission probability computation of the
latent variable.
|
void |
fire()
Consume the inputs and produce the outputs of the FFT filter.
|
static int[] |
gaussianClassifyMM(double[] y,
double[] mu,
double[] sigma,
double[] prior)
Classify the incoming symbols into hidden states
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, initialize, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
addInitializable, initialize, preinitialize, removeInitializable, wrapup
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public PortParameter prior
public PortParameter transitionMatrix
public TypedIOPort output
public TypedIOPort input
public TypedIOPort likelihood
protected int _classificationLength
protected double _likelihood
protected double[] _observations
protected int _nStates
protected double[][] _transitionMatrixEstimate
protected double[] _priors
public ObservationClassifier(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actorIllegalActionException
- If the actor cannot be contained
by the proposed container.NameDuplicationException
- If the container already has an
actor with this name.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
TypedAtomicActor
clone
in class TypedAtomicActor
workspace
- The workspace for the new object.java.lang.CloneNotSupportedException
- If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class AtomicActor<TypedIOPort>
IllegalActionException
- If a runtime type error occurs.protected final int[] classifyHMM(double[] y, double[] prior, double[][] A)
y
- input sequenceprior
- prior guess vectorsA
- transition probability matrixpublic static final int[] gaussianClassifyMM(double[] y, double[] mu, double[] sigma, double[] prior)
y
- input arraymu
- mean array containing current mean estimates for hidden statessigma
- mean array containing current standard deviation estimates for hidden statesprior
- prior distribution estimatesprotected abstract double emissionProbability(double y, int hiddenState)