Class for computing the accumulators needed for the maximum-likelihood estimate of FMLLR transforms for an acoustic model that uses diagonal Gaussian mixture models as emission densities. More...
#include <regtree-fmllr-diag-gmm.h>
Public Member Functions | |
RegtreeFmllrDiagGmmAccs () | |
~RegtreeFmllrDiagGmmAccs () | |
void | Init (size_t num_bclass, size_t dim) |
void | SetZero () |
BaseFloat | AccumulateForGmm (const RegressionTree ®tree, const AmDiagGmm &am, const VectorBase< BaseFloat > &data, size_t 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, size_t pdf_index, size_t gauss_index, BaseFloat weight) |
Accumulate stats for a single Gaussian component in the model. More... | |
void | Update (const RegressionTree ®tree, const RegtreeFmllrOptions &opts, RegtreeFmllrDiagGmm *out_fmllr, BaseFloat *auxf_impr, BaseFloat *tot_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 | |
KALDI_DISALLOW_COPY_AND_ASSIGN (RegtreeFmllrDiagGmmAccs) | |
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 accumulators needed for the maximum-likelihood estimate of FMLLR transforms for an acoustic model that uses diagonal Gaussian mixture models as emission densities.
Definition at line 148 of file regtree-fmllr-diag-gmm.h.
|
inline |
Definition at line 150 of file regtree-fmllr-diag-gmm.h.
|
inline |
Definition at line 151 of file regtree-fmllr-diag-gmm.h.
References kaldi::DeletePointers().
void AccumulateForGaussian | ( | const RegressionTree & | regtree, |
const AmDiagGmm & | am, | ||
const VectorBase< BaseFloat > & | data, | ||
size_t | pdf_index, | ||
size_t | gauss_index, | ||
BaseFloat | weight | ||
) |
Accumulate stats for a single Gaussian component in the model.
Definition at line 261 of file regtree-fmllr-diag-gmm.cc.
References SpMatrix< Real >::AddVec2(), VectorBase< Real >::CopyRowFromMat(), rnnlm::d, RegtreeFmllrDiagGmm::dim_, RegressionTree::Gauss2BaseclassId(), AmDiagGmm::GetPdf(), DiagGmm::inv_vars(), DiagGmm::means_invvars(), and VectorBase< Real >::Range().
BaseFloat AccumulateForGmm | ( | const RegressionTree & | regtree, |
const AmDiagGmm & | am, | ||
const VectorBase< BaseFloat > & | data, | ||
size_t | pdf_index, | ||
BaseFloat | weight | ||
) |
Accumulate stats for a single GMM in the model; returns log likelihood.
This does not work if the features have already been transformed with multiple feature transforms (so you can't use use this to do a 2nd pass of regression-tree fMLLR estimation, which as I write (Dan, 2016) I'm not sure that this framework even supports.
Definition at line 224 of file regtree-fmllr-diag-gmm.cc.
References MatrixBase< Real >::AddSp(), SpMatrix< Real >::AddVec2(), DiagGmm::ComponentPosteriors(), VectorBase< Real >::CopyRowFromMat(), rnnlm::d, RegtreeFmllrDiagGmm::dim_, RegressionTree::Gauss2BaseclassId(), AmDiagGmm::GetPdf(), DiagGmm::inv_vars(), DiagGmm::means_invvars(), DiagGmm::NumGauss(), VectorBase< Real >::Range(), and VectorBase< Real >::Scale().
Referenced by main(), and kaldi::UnitTestRegtreeFmllrDiagGmm().
|
inline |
Definition at line 183 of file regtree-fmllr-diag-gmm.h.
|
inline |
Accessors.
Definition at line 181 of file regtree-fmllr-diag-gmm.h.
Definition at line 197 of file regtree-fmllr-diag-gmm.cc.
References kaldi::DeletePointers(), RegtreeFmllrDiagGmm::dim_, and KALDI_ASSERT.
Referenced by main(), and kaldi::UnitTestRegtreeFmllrDiagGmm().
|
private |
|
inline |
Definition at line 182 of file regtree-fmllr-diag-gmm.h.
Definition at line 299 of file regtree-fmllr-diag-gmm.cc.
References RegtreeFmllrDiagGmm::dim_, kaldi::ExpectToken(), KALDI_ASSERT, and kaldi::ReadBasicType().
void SetZero | ( | ) |
Definition at line 217 of file regtree-fmllr-diag-gmm.cc.
Referenced by main(), and kaldi::UnitTestRegtreeFmllrDiagGmm().
void Update | ( | const RegressionTree & | regtree, |
const RegtreeFmllrOptions & | opts, | ||
RegtreeFmllrDiagGmm * | out_fmllr, | ||
BaseFloat * | auxf_impr, | ||
BaseFloat * | tot_t | ||
) | const |
Definition at line 319 of file regtree-fmllr-diag-gmm.cc.
References kaldi::ComputeFmllrMatrixDiagGmmDiagonal(), kaldi::ComputeFmllrMatrixDiagGmmFull(), kaldi::ComputeFmllrMatrixDiagGmmOffset(), kaldi::DeletePointers(), RegtreeFmllrDiagGmm::dim_, RegressionTree::GatherStats(), RegtreeFmllrDiagGmm::Init(), KALDI_ASSERT, KALDI_ERR, KALDI_LOG, KALDI_WARN, RegtreeFmllrOptions::min_count, RegtreeFmllrOptions::num_iters, RegtreeFmllrDiagGmm::set_bclass2xforms(), RegtreeFmllrDiagGmm::SetParameters(), MatrixBase< Real >::SetUnit(), RegtreeFmllrOptions::update_type, and RegtreeFmllrOptions::use_regtree.
Referenced by main(), and kaldi::UnitTestRegtreeFmllrDiagGmm().
void Write | ( | std::ostream & | out_stream, |
bool | binary | ||
) | const |
Definition at line 285 of file regtree-fmllr-diag-gmm.cc.
References RegtreeFmllrDiagGmm::dim_, kaldi::WriteBasicType(), and kaldi::WriteToken().
|
private |
Per-baseclass stats; used for accumulation.
Definition at line 189 of file regtree-fmllr-diag-gmm.h.
|
private |
Dimension of feature vectors.
Definition at line 193 of file regtree-fmllr-diag-gmm.h.
|
private |
Number of baseclasses.
Definition at line 191 of file regtree-fmllr-diag-gmm.h.