Class: DiscreteEmissionHMM | /amd/bernoulli/1/home/abt_vin/georgi/hmm/0.7/ghmm//ghmmwrapper/ghmm.py | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
HMMs with discrete emissions. Optional features: - silent states - higher order states - parameter tying in training - background probabilities in training
|
extendDurations
|
| extendDurations ( self, durationlist ) extend states with durations larger one this done by explicit state copying in C
|
getBackgroundAssignments
|
| getBackgroundAssignments ( self )
|
getSilentFlag
|
| getSilentFlag ( self, state )
|
getTieGroups
|
| getTieGroups ( self )
|
isSilent
|
| isSilent ( self, state ) Returns True if
|
logprob
|
| logprob ( self, emissionSequence, stateSequence, ) log P[ emissionSequence, stateSequence| m]
|
normalize
|
| normalize ( self ) Normalize transition probs, emission probs (if applicable)
|
pathPosterior
|
| pathPosterior ( self, sequence, path, ) Returns the log posterior probability for
|
Exceptions | |
---|---|
RuntimeError, "Models with silent states not yet supported." |
posterior ( self, sequence )
Posterior distribution matrix for sequence
.
Exceptions | |
---|---|
RuntimeError, "Models with silent states not yet supported." |
removeTiegroups ( self )
setBackground ( self, backgroundObject, stateBackground, )
Configure model to use the background distributions in backgroundObject
.
stateBackground
is a list of indixes (one for each state) refering to distributions
in backgroundObject
.
Note: values in backgroundObject are deepcopied into model
Exceptions | |
---|---|
TypeError, "BackgroundDistribution required, got " + str( emissionSequences.__class__.__name__ ) TypeError, "list required got " + str(type( stateBackground ) ) |
setEmission ( self, i, distributionParameters, )
Set the emission distribution parameters for a discrete model.
setTieGroups ( self, tieList )
statePosterior ( self, sequence, state, time, )
state
at time time
in sequence
.CAVEAT: statePosterior needs to calculate the complete forward and backward matrices. If you are interested in multiple states it would be more efficient to use the posterior function directly and not multiple calls to statePosterior
Exceptions | |
---|---|
RuntimeError, "Models with silent states not yet supported." |
toMatrices ( self )
Return the parameters in matrix form.
toXML ( self, filename, backgroundobj=None, )
updateTieGroups ( self )