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

java.lang.Object
  extended byedu.cmu.sphinx.linguist.acoustic.tiedstate.MixtureComponent

public class MixtureComponent
extends java.lang.Object

Defines the set of shared elements for a GaussianMixture. Since these elements are potentially shared by a number of GaussianMixtures, these elements should not be written to. The GaussianMixture defines a single probability density function along with a set of adaptation parameters.

Note that all scores and weights are in LogMath log base


Constructor Summary
MixtureComponent(LogMath logMath, float[] mean, float[][] meanTransformationMatrix, float[] meanTransformationVector, float[] variance, float[][] varianceTransformationMatrix, float[] varianceTransformationVector, float distFloor, float varianceFloor)
          Create a MixtureComponent with the given sub components.
 
Method Summary
 float[] getMean()
          Returns the mean for this component.
 float getScore(Data feature)
          Calculate the score for this mixture against the given feature.
 float[] getVariance()
          Returns the variance for this component.
 float precomputeDistance()
          Pre-compute factors for the Mahalanobis distance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MixtureComponent

public MixtureComponent(LogMath logMath,
                        float[] mean,
                        float[][] meanTransformationMatrix,
                        float[] meanTransformationVector,
                        float[] variance,
                        float[][] varianceTransformationMatrix,
                        float[] varianceTransformationVector,
                        float distFloor,
                        float varianceFloor)
Create a MixtureComponent with the given sub components.

Parameters:
logMath - the log math to use
mean - the mean vector for this PDF
meanTransformationMatrix - transformation matrix for this pdf
meanTransformationVector - transform vector for this PDF
variance - the variance for this PDF
varianceTransformationMatrix - var. transform matrix for this PDF
varianceTransformationVector - var. transform vector for this PDF
distFloor - the lowest score value
varianceFloor - the lowest value for the variance
Method Detail

getMean

public float[] getMean()
Returns the mean for this component.

Returns:
the mean

getVariance

public float[] getVariance()
Returns the variance for this component.

Returns:
the variance

getScore

public float getScore(Data feature)
Calculate the score for this mixture against the given feature. We model the output distributions using a mixture of Gaussians, therefore the current implementation is simply the computation of a multi-dimensional Gaussian.

Normal(x) = exp{-0.5 * (x-m)' * inv(Var) * (x-m)} / {sqrt((2 * PI) ^ N) * det(Var))}

where x and m are the incoming cepstra and mean vector respectivally, Var is the Covariance matrix, det() is the determinant of a matrix, inv() is its inverse, exp is the exponential operator, x' is the transposed vector of x and N is the dimension of the vectors x and m.

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

precomputeDistance

public float precomputeDistance()
Pre-compute factors for the Mahalanobis distance. Some of the Mahalanobis distance computation can be carried out in advance. Especifically, the factor containing only variance in the Gaussian can be computed in advance, keeping in mind that the the determinant of the covariance matrix, for the degenerate case of a mixture with independent components - only the diagonal elements are non-zero - is simply the product of the diagonal elements. We're computing the expression:

{sqrt((2 * PI) ^ N) * det(Var))}

Returns:
the precomputed distance