43 if (
vars_.size() != nmix)
46 if (
vars_[
i].NumRows() != nmix ||
47 vars_[
i].NumCols() != dim) {
55 size_t dim = fullgmm.
Dim();
56 size_t num_gauss = fullgmm.
NumGauss();
65 for (
size_t i = 0;
i < num_gauss;
i++) {
85 size_t num_comp = fullgmm->
NumGauss(), dim = fullgmm->
Dim();
86 for (
size_t i = 0;
i < num_comp;
i++) {
114 std::vector<TpMatrix<BaseFloat> > sqrt_var(num_gauss);
115 for (
int32 i = 0;
i < num_gauss;
i++) {
116 sqrt_var[
i].Resize(dim);
120 for (
int32 t = 0; t < num_frames; t++) {
void Resize(int32 nMix, int32 dim)
Resizes arrays to this dim. Does not initialize data.
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Packed symetric matrix class.
int32 Dim() const
Returns the dimensionality of the Gaussian mean vectors.
Definition for Gaussian Mixture Model with full covariances in normal mode: where the parameters are ...
MatrixIndexT NumCols() const
Returns number of columns (or zero for empty matrix).
Base class which provides matrix operations not involving resizing or allocation. ...
Definition for Gaussian Mixture Model with full covariances.
Vector< BaseFloat > weights_
weights (not log).
uint16 GmmFlagsType
Bitwise OR of the above flags.
void Resize(MatrixIndexT length, MatrixResizeType resize_type=kSetZero)
Set vector to a specified size (can be zero).
void AddSpVec(const Real alpha, const SpMatrix< Real > &M, const VectorBase< Real > &v, const Real beta)
Add symmetric positive definite matrix times vector: this <– beta*this + alpha*M*v.
std::vector< SpMatrix< double > > vars_
covariances
void CopyFromVec(const VectorBase< Real > &v)
Copy data from another vector (must match own size).
Vector< double > weights_
weights (not log).
const SubVector< Real > Row(MatrixIndexT i) const
Return specific row of matrix [const].
bool valid_gconsts_
Recompute gconsts_ if false.
void Rand(MatrixBase< BaseFloat > *feats)
Generates random features from the model.
void CopyToFullGmm(FullGmm *fullgmm, GmmFlagsType flags=kGmmAll)
Copies to FullGmm.
int32 NumGauss() const
Returns the number of mixture components in the GMM.
MatrixIndexT Dim() const
Returns the dimension of the vector.
void SetRandn()
Set vector to random normally-distributed noise.
void AddTpVec(const Real alpha, const TpMatrix< Real > &M, const MatrixTransposeType trans, const VectorBase< Real > &v, const Real beta)
Add triangular matrix times vector: this <– beta*this + alpha*M*v.
#define KALDI_ASSERT(cond)
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).
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).
std::vector< SpMatrix< BaseFloat > > inv_covars_
Inverse covariances.
MatrixIndexT RandCategorical() const
This function returns a random index into this vector, chosen with probability proportional to the co...
Matrix< BaseFloat > means_invcovars_
Means times inverse covariances.
Matrix< double > means_
Means.
Represents a non-allocating general vector which can be defined as a sub-vector of higher-level vecto...
void CopyFromFullGmm(const FullGmm &fullgmm)
Copies from given FullGmm.