20 #ifndef KALDI_GMM_DIAG_GMM_INL_H_ 21 #define KALDI_GMM_DIAG_GMM_INL_H_ 106 mean.MulElements(var);
155 #endif // KALDI_GMM_DIAG_GMM_INL_H_ This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
int32 Dim() const
Returns the dimensionality of the Gaussian mean vectors.
void SetInvVarsAndMeans(const MatrixBase< Real > &invvars, const MatrixBase< Real > &means)
Use SetInvVarsAndMeans if updating both means and (inverse) variances.
MatrixIndexT NumCols() const
Returns number of columns (or zero for empty matrix).
Base class which provides matrix operations not involving resizing or allocation. ...
void GetComponentMean(int32 gauss, VectorBase< Real > *out) const
Accessor for single component mean.
A class for storing matrices.
void CopyFromMat(const MatrixBase< OtherReal > &M, MatrixTransposeType trans=kNoTrans)
Copy given matrix. (no resize is done).
void SetMeans(const MatrixBase< Real > &m)
Use SetMeans to update only the Gaussian means (and not variances)
void CopyRowFromMat(const MatrixBase< Real > &M, MatrixIndexT row)
Extracts a row of the matrix M.
void SetComponentMean(int32 gauss, const VectorBase< Real > &in)
Mutators for single component, supports float or double Set mean for a single component - internally ...
void GetVars(Matrix< Real > *v) const
Accessor for covariances.
void CopyFromVec(const VectorBase< Real > &v)
Copy data from another vector (must match own size).
const SubVector< Real > Row(MatrixIndexT i) const
Return specific row of matrix [const].
void GetMeans(Matrix< Real > *m) const
Accessor for means.
bool valid_gconsts_
Recompute gconsts_ if false.
Matrix< BaseFloat > inv_vars_
Inverted (diagonal) variances.
int32 NumGauss() const
Returns the number of mixture components in the GMM.
MatrixIndexT Dim() const
Returns the dimension of the vector.
void MulElements(const MatrixBase< Real > &A)
Element by element multiplication with a given matrix.
void SetInvVars(const MatrixBase< Real > &v)
Set the (inverse) variances and recompute means_invvars_.
void GetComponentVariance(int32 gauss, VectorBase< Real > *out) const
Accessor for single component variance.
void InvertElements()
Inverts all the elements of the matrix.
Vector< BaseFloat > weights_
weights (not log).
A class representing a vector.
void InvertElements()
Invert all elements.
#define KALDI_ASSERT(cond)
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).
void CopyRowFromVec(const VectorBase< Real > &v, const MatrixIndexT row)
Copy vector into specific row of matrix.
void DivElements(const VectorBase< Real > &v)
Divide element-by-element by a vector.
void Resize(const MatrixIndexT r, const MatrixIndexT c, MatrixResizeType resize_type=kSetZero, MatrixStrideType stride_type=kDefaultStride)
Sets matrix to a specified size (zero is OK as long as both r and c are zero).
void SetComponentInvVar(int32 gauss, const VectorBase< Real > &in)
Set inv-var for single component (recommend to do this before setting the mean, if doing both...
void SetWeights(const VectorBase< Real > &w)
Mutators for both float or double.
Provides a vector abstraction class.
Matrix< BaseFloat > means_invvars_
Means times inverted variance.
void SetComponentWeight(int32 gauss, BaseFloat weight)
Set weight for single component.