edu.cmu.sphinx.linguist.acoustic.tiedstate
Class GaussianMixture

java.lang.Object
  extended byedu.cmu.sphinx.linguist.acoustic.tiedstate.GaussianMixture
All Implemented Interfaces:
Senone, java.io.Serializable

public class GaussianMixture
extends java.lang.Object
implements Senone

Represents a concrete implementation of a simple senone. A simple senone is a set of probability density functions implemented as a gaussian mixture.

All scores and weights are maintained in LogMath log base.

See Also:
Serialized Form

Constructor Summary
GaussianMixture(LogMath logMath, float[] logMixtureWeights, MixtureComponent[] mixtureComponents, long id)
          Creates a new senone from the given components.
 
Method Summary
 float[] calculateComponentScore(Data feature)
          Calculates the scores for each component in the senone.
 float calculateScore(Data feature)
          Calculates the score for the senone.
 void dump(java.lang.String msg)
          Dumps this senone.
 boolean equals(java.lang.Object o)
          Determines if two objects are equal
 long getID()
          Gets the ID for this senone
 MixtureComponent[] getMixtureComponents()
          Returns the mixture components associated with this Gaussian
 float getScore(Data feature)
          Returns a score for the given feature based upon this senone, and calculates it if not already calculated.
 int hashCode()
          Returns the hashcode for this object
 java.lang.String toString()
          Retrieves a string form of this object
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GaussianMixture

public GaussianMixture(LogMath logMath,
                       float[] logMixtureWeights,
                       MixtureComponent[] mixtureComponents,
                       long id)
Creates a new senone from the given components.

Parameters:
logMath - the log math
logMixtureWeights - the mixture weights for this senone in LogMath log base
mixtureComponents - the mixture components for this senone
Method Detail

dump

public void dump(java.lang.String msg)
Dumps this senone.

Specified by:
dump in interface Senone
Parameters:
msg - annotation message

getScore

public float getScore(Data feature)
Returns a score for the given feature based upon this senone, and calculates it if not already calculated. Note that this method is not thread safe and should be externally synchronized if it could be potentially called from multiple threads.

Specified by:
getScore in interface Senone
Parameters:
feature - the feature to score
Returns:
the score, in logMath log base, for the feature

equals

public boolean equals(java.lang.Object o)
Determines if two objects are equal

Parameters:
o - the object to compare to this.
Returns:
true if the objects are equal

hashCode

public int hashCode()
Returns the hashcode for this object

Returns:
the hashcode

getID

public long getID()
Gets the ID for this senone

Specified by:
getID in interface Senone
Returns:
the senone id

toString

public java.lang.String toString()
Retrieves a string form of this object

Returns:
the string representation of this object

calculateScore

public float calculateScore(Data feature)
Calculates the score for the senone.

Parameters:
feature - the feature to score
Returns:
the score, in logMath log base, for the feature

calculateComponentScore

public float[] calculateComponentScore(Data feature)
Calculates the scores for each component in the senone.

Specified by:
calculateComponentScore in interface Senone
Parameters:
feature - the feature to score
Returns:
the LogMath log scores for the feature, one for each component

getMixtureComponents

public MixtureComponent[] getMixtureComponents()
Returns the mixture components associated with this Gaussian

Returns:
the array of mixture components