public class MixtureComponent
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
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
| Modifier and Type | Field and Description |
|---|---|
static float |
DEFAULT_DIST_FLOOR |
static float |
DEFAULT_VAR_FLOOR |
protected float |
distFloor |
protected float |
logPreComputedGaussianFactor |
protected float[] |
meanTransformed
Mean after transformed by the adaptation parameters.
|
protected float[] |
precisionTransformed
Precision is the inverse of the variance.
|
| Constructor and Description |
|---|
MixtureComponent(float[] mean,
float[] variance)
Create a MixtureComponent with the given sub components.
|
MixtureComponent(float[] mean,
float[][] meanTransformationMatrix,
float[] meanTransformationVector,
float[] variance,
float[][] varianceTransformationMatrix,
float[] varianceTransformationVector)
Create a MixtureComponent with the given sub components.
|
MixtureComponent(float[] mean,
float[][] meanTransformationMatrix,
float[] meanTransformationVector,
float[] variance,
float[][] varianceTransformationMatrix,
float[] varianceTransformationVector,
float distFloor,
float varianceFloor)
Create a MixtureComponent with the given sub components.
|
| Modifier and Type | Method and Description |
|---|---|
MixtureComponent |
clone() |
float[] |
getMean()
Returns the mean for this component.
|
float |
getScore(float[] feature)
Calculate the score for this mixture against the given feature.
|
float |
getScore(FloatData 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.
|
java.lang.String |
toString() |
void |
transformStats()
Applies transformations to means and variances.
|
protected float[] meanTransformed
protected float[] precisionTransformed
protected float distFloor
public static final float DEFAULT_VAR_FLOOR
public static final float DEFAULT_DIST_FLOOR
protected float logPreComputedGaussianFactor
public MixtureComponent(float[] mean,
float[] variance)
mean - the mean vector for this PDFvariance - the variance for this PDFpublic MixtureComponent(float[] mean,
float[][] meanTransformationMatrix,
float[] meanTransformationVector,
float[] variance,
float[][] varianceTransformationMatrix,
float[] varianceTransformationVector)
mean - the mean vector for this PDFmeanTransformationMatrix - transformation matrix for this pdfmeanTransformationVector - transform vector for this PDFvariance - the variance for this PDFvarianceTransformationMatrix - var. transform matrix for this PDFvarianceTransformationVector - var. transform vector for this PDFpublic MixtureComponent(float[] mean,
float[][] meanTransformationMatrix,
float[] meanTransformationVector,
float[] variance,
float[][] varianceTransformationMatrix,
float[] varianceTransformationVector,
float distFloor,
float varianceFloor)
mean - the mean vector for this PDFmeanTransformationMatrix - transformation matrix for this pdfmeanTransformationVector - transform vector for this PDFvariance - the variance for this PDFvarianceTransformationMatrix - var. transform matrix for this PDFvarianceTransformationVector - var. transform vector for this PDFdistFloor - the lowest score value (in linear domain)varianceFloor - the lowest value for the variancepublic float[] getMean()
public float[] getVariance()
public float getScore(FloatData feature)
Note: The support of DoubleData-features would require an array conversion to
float[]. Because getScore might be invoked with very high frequency, features are restricted
to be FloatDatas.
feature - the feature to scorepublic float getScore(float[] feature)
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 respectively, 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.
feature - the feature to scorepublic float precomputeDistance()
We're computing the expression:
{sqrt((2 * PI) ^ N) * det(Var))}public void transformStats()
public MixtureComponent clone() throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic java.lang.String toString()
toString in class java.lang.Object