Class for computing the maximum-likelihood estimates of the parameters of an acoustic model that uses diagonal Gaussian mixture models as emission densities. More...
#include <regtree-mllr-diag-gmm.h>
Public Member Functions | |
RegtreeMllrDiagGmmAccs () | |
~RegtreeMllrDiagGmmAccs () | |
void | Init (int32 num_bclass, int32 dim) |
void | SetZero () |
BaseFloat | AccumulateForGmm (const RegressionTree ®tree, const AmDiagGmm &am, const VectorBase< BaseFloat > &data, int32 pdf_index, BaseFloat weight) |
Accumulate stats for a single GMM in the model; returns log likelihood. More... | |
void | AccumulateForGaussian (const RegressionTree ®tree, const AmDiagGmm &am, const VectorBase< BaseFloat > &data, int32 pdf_index, int32 gauss_index, BaseFloat weight) |
Accumulate stats for a single Gaussian component in the model. More... | |
void | Update (const RegressionTree ®tree, const RegtreeMllrOptions &opts, RegtreeMllrDiagGmm *out_mllr, BaseFloat *auxf_impr, BaseFloat *t) const |
void | Write (std::ostream &out_stream, bool binary) const |
void | Read (std::istream &in_stream, bool binary, bool add) |
int32 | Dim () const |
Accessors. More... | |
int32 | NumBaseClasses () const |
const std::vector< AffineXformStats * > & | baseclass_stats () const |
Private Member Functions | |
BaseFloat | MllrObjFunction (const Matrix< BaseFloat > &xform, int32 bclass_id) const |
Returns the MLLR objective function for a given transform and baseclass. More... | |
KALDI_DISALLOW_COPY_AND_ASSIGN (RegtreeMllrDiagGmmAccs) | |
Private Attributes | |
std::vector< AffineXformStats * > | baseclass_stats_ |
Per-baseclass stats; used for accumulation. More... | |
int32 | num_baseclasses_ |
Number of baseclasses. More... | |
int32 | dim_ |
Dimension of feature vectors. More... | |
Class for computing the maximum-likelihood estimates of the parameters of an acoustic model that uses diagonal Gaussian mixture models as emission densities.
Definition at line 103 of file regtree-mllr-diag-gmm.h.
|
inline |
Definition at line 105 of file regtree-mllr-diag-gmm.h.
|
inline |
Definition at line 106 of file regtree-mllr-diag-gmm.h.
References kaldi::DeletePointers().
void AccumulateForGaussian | ( | const RegressionTree & | regtree, |
const AmDiagGmm & | am, | ||
const VectorBase< BaseFloat > & | data, | ||
int32 | pdf_index, | ||
int32 | gauss_index, | ||
BaseFloat | weight | ||
) |
Accumulate stats for a single Gaussian component in the model.
Definition at line 222 of file regtree-mllr-diag-gmm.cc.
References SpMatrix< Real >::AddVec2(), VectorBase< Real >::CopyFromVec(), rnnlm::d, RegtreeMllrDiagGmm::dim_, RegressionTree::Gauss2BaseclassId(), DiagGmm::GetComponentMean(), AmDiagGmm::GetPdf(), DiagGmm::inv_vars(), VectorBase< Real >::MulElements(), and MatrixBase< Real >::Row().
BaseFloat AccumulateForGmm | ( | const RegressionTree & | regtree, |
const AmDiagGmm & | am, | ||
const VectorBase< BaseFloat > & | data, | ||
int32 | pdf_index, | ||
BaseFloat | weight | ||
) |
Accumulate stats for a single GMM in the model; returns log likelihood.
This does not work with multiple feature transforms.
Definition at line 185 of file regtree-mllr-diag-gmm.cc.
References SpMatrix< Real >::AddVec2(), DiagGmm::ComponentPosteriors(), VectorBase< Real >::CopyFromVec(), rnnlm::d, RegtreeMllrDiagGmm::dim_, RegressionTree::Gauss2BaseclassId(), DiagGmm::GetComponentMean(), AmDiagGmm::GetPdf(), DiagGmm::inv_vars(), VectorBase< Real >::MulElements(), DiagGmm::NumGauss(), MatrixBase< Real >::Row(), VectorBase< Real >::Scale(), and PackedMatrix< Real >::SetZero().
Referenced by main(), and UnitTestRegtreeMllrDiagGmm().
|
inline |
Definition at line 135 of file regtree-mllr-diag-gmm.h.
|
inline |
Accessors.
Definition at line 133 of file regtree-mllr-diag-gmm.h.
Definition at line 159 of file regtree-mllr-diag-gmm.cc.
References kaldi::DeletePointers(), RegtreeMllrDiagGmm::dim_, and KALDI_ASSERT.
Referenced by main(), and UnitTestRegtreeMllrDiagGmm().
|
private |
Returns the MLLR objective function for a given transform and baseclass.
|
inline |
Definition at line 134 of file regtree-mllr-diag-gmm.h.
Definition at line 264 of file regtree-mllr-diag-gmm.cc.
References RegtreeMllrDiagGmm::dim_, kaldi::ExpectToken(), KALDI_ASSERT, and kaldi::ReadBasicType().
Referenced by TestMllrAccsIO().
void SetZero | ( | ) |
Definition at line 178 of file regtree-mllr-diag-gmm.cc.
Referenced by main().
void Update | ( | const RegressionTree & | regtree, |
const RegtreeMllrOptions & | opts, | ||
RegtreeMllrDiagGmm * | out_mllr, | ||
BaseFloat * | auxf_impr, | ||
BaseFloat * | t | ||
) | const |
Definition at line 322 of file regtree-mllr-diag-gmm.cc.
References kaldi::ComputeMllrMatrix(), kaldi::DeletePointers(), RegtreeMllrDiagGmm::dim_, RegressionTree::GatherStats(), RegtreeMllrDiagGmm::Init(), KALDI_ASSERT, KALDI_LOG, KALDI_WARN, RegtreeMllrOptions::min_count, kaldi::MllrAuxFunction(), RegtreeMllrDiagGmm::set_bclass2xforms(), RegtreeMllrDiagGmm::SetParameters(), MatrixBase< Real >::SetUnit(), and RegtreeMllrOptions::use_regtree.
Referenced by main(), TestMllrAccsIO(), and TestXformMean().
void Write | ( | std::ostream & | out_stream, |
bool | binary | ||
) | const |
Definition at line 250 of file regtree-mllr-diag-gmm.cc.
References RegtreeMllrDiagGmm::dim_, kaldi::WriteBasicType(), and kaldi::WriteToken().
Referenced by TestMllrAccsIO().
|
private |
Per-baseclass stats; used for accumulation.
Definition at line 141 of file regtree-mllr-diag-gmm.h.
|
private |
Dimension of feature vectors.
Definition at line 143 of file regtree-mllr-diag-gmm.h.
|
private |
Number of baseclasses.
Definition at line 142 of file regtree-mllr-diag-gmm.h.