#include <vector>
#include "base/kaldi-math.h"
#include "gmm/model-test-common.h"
#include "sgmm2/am-sgmm2.h"
#include "sgmm2/fmllr-sgmm2.h"
#include "util/kaldi-io.h"
Go to the source code of this file.
Functions | |
void | ApplyFmllrXform (const kaldi::VectorBase< BaseFloat > &in, const Matrix< BaseFloat > &xf, Vector< BaseFloat > *out) |
void | TestSgmm2FmllrAccsIO (const AmSgmm2 &sgmm, const kaldi::Matrix< BaseFloat > &feats) |
void | TestSgmm2FmllrSubspace (const AmSgmm2 &sgmm, const kaldi::Matrix< BaseFloat > &feats) |
void | TestSgmm2Fmllr () |
int | main () |
void ApplyFmllrXform | ( | const kaldi::VectorBase< BaseFloat > & | in, |
const Matrix< BaseFloat > & | xf, | ||
Vector< BaseFloat > * | out | ||
) |
Definition at line 38 of file fmllr-sgmm2-test.cc.
References VectorBase< Real >::AddMatVec(), VectorBase< Real >::Dim(), KALDI_ASSERT, kaldi::kNoTrans, kaldi::kSetZero, MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), and Vector< Real >::Resize().
Referenced by TestSgmm2FmllrAccsIO().
int main | ( | ) |
Definition at line 237 of file fmllr-sgmm2-test.cc.
References kaldi::g_kaldi_verbose_level, rnnlm::i, and TestSgmm2Fmllr().
void TestSgmm2Fmllr | ( | ) |
Definition at line 200 of file fmllr-sgmm2-test.cc.
References AmSgmm2::ComputeNormalizers(), rnnlm::d, kaldi::Exp(), AmSgmm2::InitializeFromFullGmm(), kaldi::unittest::InitRandFullGmm(), kaldi::unittest::RandDiagGaussFeatures(), kaldi::RandGauss(), kaldi::RandInt(), Matrix< Real >::Resize(), MatrixBase< Real >::Row(), TestSgmm2FmllrAccsIO(), and TestSgmm2FmllrSubspace().
Referenced by main().
void TestSgmm2FmllrAccsIO | ( | const AmSgmm2 & | sgmm, |
const kaldi::Matrix< BaseFloat > & | feats | ||
) |
Definition at line 52 of file fmllr-sgmm2-test.cc.
References FmllrSgmm2Accs::Accumulate(), ApplyFmllrXform(), kaldi::AssertEqual(), AmSgmm2::ComputeFmllrPreXform(), AmSgmm2::ComputePerFrameVars(), AmSgmm2::FeatureDim(), Sgmm2FmllrConfig::fmllr_min_count, Sgmm2GselectConfig::full_gmm_nbest, AmSgmm2::GaussianSelection(), rnnlm::i, FmllrSgmm2Accs::Init(), Sgmm2FmllrGlobalParams::inv_xform_, KALDI_LOG, KALDI_WARN, AmSgmm2::LogLikelihood(), Sgmm2FmllrGlobalParams::mean_scatter_, AmSgmm2::NumGauss(), AmSgmm2::NumGroups(), AmSgmm2::NumPdfs(), MatrixBase< Real >::NumRows(), AmSgmm2::PhoneSpaceDim(), Sgmm2FmllrGlobalParams::pre_xform_, FmllrSgmm2Accs::Read(), Sgmm2PerFrameDerivedVars::Resize(), MatrixBase< Real >::Row(), VectorBase< Real >::Set(), MatrixBase< Real >::SetUnit(), Input::Stream(), FmllrSgmm2Accs::Update(), and FmllrSgmm2Accs::Write().
Referenced by TestSgmm2Fmllr().
void TestSgmm2FmllrSubspace | ( | const AmSgmm2 & | sgmm, |
const kaldi::Matrix< BaseFloat > & | feats | ||
) |
Definition at line 153 of file fmllr-sgmm2-test.cc.
References FmllrSgmm2Accs::Accumulate(), FmllrSgmm2Accs::AccumulateForFmllrSubspace(), AmSgmm2::ComputeFmllrPreXform(), AmSgmm2::ComputePerFrameVars(), kaldi::EstimateSgmm2FmllrSubspace(), AmSgmm2::FeatureDim(), Sgmm2GselectConfig::full_gmm_nbest, AmSgmm2::GaussianSelection(), rnnlm::i, FmllrSgmm2Accs::Init(), Sgmm2FmllrGlobalParams::inv_xform_, KALDI_LOG, KALDI_WARN, Sgmm2FmllrGlobalParams::mean_scatter_, Sgmm2FmllrConfig::num_fmllr_bases, AmSgmm2::NumGauss(), AmSgmm2::NumPdfs(), MatrixBase< Real >::NumRows(), AmSgmm2::PhoneSpaceDim(), Sgmm2FmllrGlobalParams::pre_xform_, Sgmm2PerFrameDerivedVars::Resize(), MatrixBase< Real >::Row(), VectorBase< Real >::Set(), MatrixBase< Real >::SetUnit(), and FmllrSgmm2Accs::Update().
Referenced by TestSgmm2Fmllr().