Definition for Gaussian Mixture Model with full covariances in normal mode: where the parameters are stored as means and variances (instead of the exponential form that the FullGmm class is stored as). More...
#include <full-gmm-normal.h>
Public Member Functions | |
FullGmmNormal () | |
Empty constructor. More... | |
FullGmmNormal (const FullGmm &gmm) | |
void | Resize (int32 nMix, int32 dim) |
Resizes arrays to this dim. Does not initialize data. More... | |
void | CopyFromFullGmm (const FullGmm &fullgmm) |
Copies from given FullGmm. More... | |
void | CopyToFullGmm (FullGmm *fullgmm, GmmFlagsType flags=kGmmAll) |
Copies to FullGmm. More... | |
void | Rand (MatrixBase< BaseFloat > *feats) |
Generates random features from the model. More... | |
KALDI_DISALLOW_COPY_AND_ASSIGN (FullGmmNormal) | |
Public Attributes | |
Vector< double > | weights_ |
weights (not log). More... | |
Matrix< double > | means_ |
Means. More... | |
std::vector< SpMatrix< double > > | vars_ |
covariances More... | |
Definition for Gaussian Mixture Model with full covariances in normal mode: where the parameters are stored as means and variances (instead of the exponential form that the FullGmm class is stored as).
This class will be used in the update (since the update formulas are for the standard parameterization) and then copied to the exponential form of the FullGmm class. The FullGmmNormal class will not be used anywhere else, and should not have any extra methods that are not needed.
Definition at line 45 of file full-gmm-normal.h.
|
inline |
|
inlineexplicit |
Definition at line 50 of file full-gmm-normal.h.
References FullGmmNormal::CopyFromFullGmm(), FullGmmNormal::CopyToFullGmm(), kaldi::kGmmAll, FullGmmNormal::Rand(), and FullGmmNormal::Resize().
void CopyFromFullGmm | ( | const FullGmm & | fullgmm | ) |
Copies from given FullGmm.
resize the variables to fit the gmm
copy weights
we need to split the natural components for each gaussian
Definition at line 53 of file full-gmm-normal.cc.
References VectorBase< Real >::CopyFromVec(), FullGmm::Dim(), rnnlm::i, FullGmm::inv_covars_, FullGmmNormal::means_, FullGmm::means_invcovars_, FullGmm::NumGauss(), FullGmmNormal::Resize(), MatrixBase< Real >::Row(), FullGmmNormal::vars_, FullGmmNormal::weights_, and FullGmm::weights_.
Referenced by FullGmmNormal::FullGmmNormal().
void CopyToFullGmm | ( | FullGmm * | fullgmm, |
GmmFlagsType | flags = kGmmAll |
||
) |
Copies to FullGmm.
Definition at line 76 of file full-gmm-normal.cc.
References VectorBase< Real >::AddSpVec(), FullGmm::Dim(), VectorBase< Real >::Dim(), rnnlm::i, FullGmm::inv_covars_, KALDI_ASSERT, kaldi::kGmmMeans, kaldi::kGmmVariances, kaldi::kGmmWeights, FullGmmNormal::means_, FullGmm::means_invcovars_, MatrixBase< Real >::NumCols(), FullGmm::NumGauss(), MatrixBase< Real >::Row(), FullGmm::valid_gconsts_, FullGmmNormal::vars_, FullGmmNormal::weights_, and FullGmm::weights_.
Referenced by Sgmm2Project::ApplyProjection(), FullGmmNormal::FullGmmNormal(), kaldi::MleFullGmmUpdate(), and UnitTestEstimateFullGmm().
KALDI_DISALLOW_COPY_AND_ASSIGN | ( | FullGmmNormal | ) |
void Rand | ( | MatrixBase< BaseFloat > * | feats | ) |
Generates random features from the model.
Definition at line 110 of file full-gmm-normal.cc.
References VectorBase< Real >::AddTpVec(), VectorBase< Real >::CopyFromVec(), rnnlm::i, KALDI_ASSERT, kaldi::kNoTrans, FullGmmNormal::means_, MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), VectorBase< Real >::RandCategorical(), MatrixBase< Real >::Row(), VectorBase< Real >::SetRandn(), FullGmmNormal::vars_, and FullGmmNormal::weights_.
Referenced by FullGmmNormal::FullGmmNormal(), UnitTestFullGmmEst(), and kaldi::UnitTestIvectorExtractor().
Resizes arrays to this dim. Does not initialize data.
Definition at line 33 of file full-gmm-normal.cc.
References VectorBase< Real >::Dim(), rnnlm::i, KALDI_ASSERT, FullGmmNormal::means_, MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), Vector< Real >::Resize(), Matrix< Real >::Resize(), FullGmmNormal::vars_, and FullGmmNormal::weights_.
Referenced by FullGmmNormal::CopyFromFullGmm(), and FullGmmNormal::FullGmmNormal().
Matrix<double> means_ |
Means.
Definition at line 67 of file full-gmm-normal.h.
Referenced by Sgmm2Project::ApplyProjection(), Sgmm2Project::ComputeLdaStats(), FullGmmNormal::CopyFromFullGmm(), FullGmmNormal::CopyToFullGmm(), FullGmm::Interpolate(), DiagGmm::Interpolate(), kaldi::MleFullGmmUpdate(), FullGmmNormal::Rand(), FullGmmNormal::Resize(), and UnitTestEstimateFullGmm().
std::vector<SpMatrix<double> > vars_ |
covariances
Definition at line 68 of file full-gmm-normal.h.
Referenced by Sgmm2Project::ApplyProjection(), Sgmm2Project::ComputeLdaStats(), FullGmmNormal::CopyFromFullGmm(), FullGmmNormal::CopyToFullGmm(), FullGmm::Interpolate(), DiagGmm::Interpolate(), kaldi::MleFullGmmUpdate(), FullGmmNormal::Rand(), FullGmmNormal::Resize(), and UnitTestEstimateFullGmm().
Vector<double> weights_ |
weights (not log).
Definition at line 66 of file full-gmm-normal.h.
Referenced by FullGmmNormal::CopyFromFullGmm(), FullGmmNormal::CopyToFullGmm(), FullGmm::Interpolate(), DiagGmm::Interpolate(), kaldi::MleFullGmmUpdate(), FullGmmNormal::Rand(), and FullGmmNormal::Resize().