44 accs.
Update(regtree, opts, &mllr, NULL, NULL);
51 for (
int32 j = 0;
j < npoints;
j++) {
54 KALDI_LOG <<
"Per-frame loglike after adaptation = " << (loglike/npoints)
55 <<
" over " << npoints <<
" frames.";
73 accs1->
Update(regtree, opts, &mllr1, NULL, NULL);
90 accs2->
Update(regtree, opts, &mllr2, NULL, NULL);
111 accs.
Update(regtree, opts, &mllr, NULL, NULL);
126 for (
int32 j = 0;
j < npoints;
j++) {
130 KALDI_LOG <<
"Per-frame loglike after adaptation = " << (loglike0/npoints)
131 <<
" over " << npoints <<
" frames.";
141 for (
int32 j = 0;
j < npoints;
j++) {
160 int32 npoints = dim*(dim+1)*10 + 500;
162 for (
int32 j = 0;
j < npoints;
j++) {
168 std::vector<int32> sil_indices;
170 state_occs(0) = npoints;
171 regtree.
BuildTree(state_occs, sil_indices, am_gmm, 1);
176 accs.
Init(num_bclass, dim);
177 for (
int32 j = 0;
j < npoints;
j++) {
181 KALDI_LOG <<
"Per-frame loglike during accumulations = " << (loglike/npoints)
182 <<
" over " << npoints <<
" frames.";
190 for (
int i = 0;
i <= 10;
i++)
192 std::cout <<
"Test OK.\n";
void CopyFromAmDiagGmm(const AmDiagGmm &other)
Copies the parameters from another model. Allocates necessary memory.
void CopyFromDiagGmm(const DiagGmm &diaggmm)
Copies from given DiagGmm.
void SetInvVarsAndMeans(const MatrixBase< Real > &invvars, const MatrixBase< Real > &means)
Use SetInvVarsAndMeans if updating both means and (inverse) variances.
An MLLR mean transformation is an affine transformation of Gaussian means.
void UnitTestRegtreeMllrDiagGmm()
void TransformModel(const RegressionTree ®tree, AmDiagGmm *am)
Apply the transform(s) to all the Gaussian means in the model.
Configuration variables for FMLLR transforms.
bool use_regtree
If 'true', find transforms to generate using regression tree.
BaseFloat min_count
Minimum occupancy for computing a transform.
int32 ComputeGconsts()
Sets the gconsts.
void TestXformMean(const kaldi::AmDiagGmm &am_gmm, const kaldi::RegressionTree ®tree, const RegtreeMllrDiagGmmAccs &accs, const kaldi::Matrix< BaseFloat > adapt_data)
void Init(int32 num_bclass, int32 dim)
void Read(std::istream &in_stream, bool binary, bool add)
int32 NumBaseclasses() const
Accessors (const)
const SubVector< Real > Row(MatrixIndexT i) const
Return specific row of matrix [const].
BaseFloat LogLikelihood(const int32 pdf_index, const VectorBase< BaseFloat > &data) const
void BuildTree(const Vector< BaseFloat > &state_occs, const std::vector< int32 > &sil_indices, const AmDiagGmm &am, int32 max_clusters)
Top-down clustering of the Gaussians in a model based on their means.
A regression tree is a clustering of Gaussian densities in an acoustic model, such that the group of ...
void InitRandDiagGmm(int32 dim, int32 num_comp, DiagGmm *gmm)
BaseFloat LogLikelihood(const VectorBase< BaseFloat > &data) const
Returns the log-likelihood of a data point (vector) given the GMM.
int32 NumGauss() const
Returns the number of mixture components in the GMM.
Class for computing the maximum-likelihood estimates of the parameters of an acoustic model that uses...
void GetTransformedMeans(const RegressionTree ®tree, const AmDiagGmm &am, int32 pdf_index, MatrixBase< BaseFloat > *out) const
Get all the transformed means for a given pdf.
DiagGmm & GetPdf(int32 pdf_index)
Accessors.
A class representing a vector.
int32 g_kaldi_verbose_level
This is set by util/parse-options.
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).
void Write(std::ostream &out_stream, bool binary) const
static void AssertEqual(float a, float b, float relative_tolerance=0.001)
assert abs(a - b) <= relative_tolerance * (abs(a)+abs(b))
Definition for Gaussian Mixture Model with diagonal covariances.
void Generate(VectorBase< BaseFloat > *output)
Generates a random data-point from this distribution.
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.
void Update(const RegressionTree ®tree, const RegtreeMllrOptions &opts, RegtreeMllrDiagGmm *out_mllr, BaseFloat *auxf_impr, BaseFloat *t) const
void Init(const DiagGmm &proto, int32 num_pdfs)
Initializes with a single "prototype" GMM.
Represents a non-allocating general vector which can be defined as a sub-vector of higher-level vecto...
void TestMllrAccsIO(const kaldi::AmDiagGmm &am_gmm, const kaldi::RegressionTree ®tree, const RegtreeMllrDiagGmmAccs &accs, const kaldi::Matrix< BaseFloat > adapt_data)
int32 RandInt(int32 min_val, int32 max_val, struct RandomState *state)
const Matrix< BaseFloat > & inv_vars() const