|
Sautrela | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.gtts.sautrela.wfsa.models.HMM
public class HMM
Array version of Discrete Hidden Markov Model
| Nested Class Summary | |
|---|---|
class |
HMM.State
|
class |
HMM.Symbol
|
| Nested classes/interfaces inherited from interface edu.gtts.sautrela.wfsa.WFSA |
|---|
WFSA.Factory |
| Field Summary | |
|---|---|
static WFSA.Factory |
myFactory
|
| Constructor Summary | |
|---|---|
HMM(org.xml.sax.InputSource is)
Creates a HMM using an XML description found via an InputSource |
|
HMM(org.xml.sax.InputSource is,
Alphabet<HMM.Symbol> alphabet)
Creates a HMM using a XML description found via an InputSource
and using an existing Alphabet. |
|
| Method Summary | |
|---|---|
void |
dumpTrainCounts()
Dumps the trained data to the HMM. |
Alphabet<HMM.Symbol> |
getAlphabet()
Returns the alphabet of the Model. |
double |
getFinProb(HMM.State state)
Returns the probability of being final |
HMM.State |
getIniState()
Returns the initial State |
java.lang.String |
getName()
Returns the name of the Model. |
DefaultTransition<HMM.State,HMM.Symbol> |
getRandomTrans(HMM.State state)
Returns a random transitions from a state |
HMM.Symbol |
getSymbolByName(java.lang.String name)
|
DefaultTransition<HMM.State,HMM.Symbol>[] |
getTrans(HMM.State from)
Returns all possible transitions from a state. |
DefaultTransition<HMM.State,HMM.Symbol>[] |
getTrans(HMM.State from,
HMM.Symbol symbol)
Returns all possible transitions for the given source state and symbol. |
java.lang.Iterable<DefaultTransition<HMM.State,HMM.Symbol>> |
getTrans2(HMM.State state)
|
java.lang.Iterable<DefaultTransition<HMM.State,HMM.Symbol>> |
getTrans2(HMM.State state,
HMM.Symbol symbol)
|
void |
incrementTrainCount(DefaultTransition<HMM.State,HMM.Symbol> t,
double count)
Increments the training counts associated to a Transition. |
void |
incrementTrainCount(HMM.State state,
double count)
Increments the training counts associated to a final state. |
void |
initTrainCounts(double initCount)
Initializes the training counts. |
void |
setName(java.lang.String name)
Sets the name of the HMM. |
java.lang.String |
toString()
Returns a string representation of the object. |
java.lang.String |
toXML()
Returns a XML representation of the HMM |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final WFSA.Factory myFactory
| Constructor Detail |
|---|
public HMM(org.xml.sax.InputSource is)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
java.io.IOException
InputSource
is - the InputSource used to locate the XML description
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
public HMM(org.xml.sax.InputSource is,
Alphabet<HMM.Symbol> alphabet)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
java.io.IOException
InputSource
and using an existing Alphabet. The alphabet could grow.
is - the InputSource used to locate the XML descriptionalphabet - an existing Alphabet
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException| Method Detail |
|---|
public void setName(java.lang.String name)
name - the name of this HMMpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getName()
WFSA
getName in interface WFSA<HMM.State,HMM.Symbol,DefaultTransition<HMM.State,HMM.Symbol>>public HMM.Symbol getSymbolByName(java.lang.String name)
public Alphabet<HMM.Symbol> getAlphabet()
WFSA
getAlphabet in interface WFSA<HMM.State,HMM.Symbol,DefaultTransition<HMM.State,HMM.Symbol>>Alphabetpublic double getFinProb(HMM.State state)
WFSA
getFinProb in interface WFSA<HMM.State,HMM.Symbol,DefaultTransition<HMM.State,HMM.Symbol>>public HMM.State getIniState()
WFSA
getIniState in interface WFSA<HMM.State,HMM.Symbol,DefaultTransition<HMM.State,HMM.Symbol>>public DefaultTransition<HMM.State,HMM.Symbol>[] getTrans(HMM.State from)
WFSA
getTrans in interface WFSA<HMM.State,HMM.Symbol,DefaultTransition<HMM.State,HMM.Symbol>>from - The source State
array must be returned.public DefaultTransition<HMM.State,HMM.Symbol> getRandomTrans(HMM.State state)
WFSA
getRandomTrans in interface WFSA<HMM.State,HMM.Symbol,DefaultTransition<HMM.State,HMM.Symbol>>state - The source State
public java.lang.Iterable<DefaultTransition<HMM.State,HMM.Symbol>> getTrans2(HMM.State state)
throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
public java.lang.Iterable<DefaultTransition<HMM.State,HMM.Symbol>> getTrans2(HMM.State state,
HMM.Symbol symbol)
throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException
public DefaultTransition<HMM.State,HMM.Symbol>[] getTrans(HMM.State from,
HMM.Symbol symbol)
NdWFSA
getTrans in interface NdWFSA<HMM.State,HMM.Symbol,DefaultTransition<HMM.State,HMM.Symbol>>from - the source Statesymbol - the observed symbol
array must be returned.public void initTrainCounts(double initCount)
WFSAinitCount is used as initial posterior probability count
of the WFSA (MAP training). This count must be distributed
among all the internal parameters according to their prior probabilities.
initTrainCounts in interface WFSA<HMM.State,HMM.Symbol,DefaultTransition<HMM.State,HMM.Symbol>>initCount - initial posterior probability count
public void incrementTrainCount(HMM.State state,
double count)
WFSAState.
incrementTrainCount in interface WFSA<HMM.State,HMM.Symbol,DefaultTransition<HMM.State,HMM.Symbol>>state - the final Satecount - the training count.
public void incrementTrainCount(DefaultTransition<HMM.State,HMM.Symbol> t,
double count)
WFSATransition.
These counts are related to the probability of a Transition.
incrementTrainCount in interface WFSA<HMM.State,HMM.Symbol,DefaultTransition<HMM.State,HMM.Symbol>>t - the Transitioncount - the training count.public void dumpTrainCounts()
p'= (p * C + count) / NormaC=Max{(1-count)/prob,0} for
each probability distribution. This constant ensures that the minimun
probability (prior to normalization) will be 1.
dumpTrainCounts in interface WFSA<HMM.State,HMM.Symbol,DefaultTransition<HMM.State,HMM.Symbol>>public java.lang.String toXML()
toXML in interface WFSA<HMM.State,HMM.Symbol,DefaultTransition<HMM.State,HMM.Symbol>>
|
Sautrela | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||