Definition for Gaussian Mixture Model with diagonal covariances. More...
#include <diag-gmm.h>
Public Member Functions | |
DiagGmm () | |
Empty constructor. More... | |
DiagGmm (const DiagGmm &gmm) | |
DiagGmm (const GaussClusterable &gc, BaseFloat var_floor) | |
Initializer from GaussClusterable initializes the DiagGmm as a single Gaussian from tree stats. More... | |
void | CopyFromNormal (const DiagGmmNormal &diag_gmm_normal) |
Copies from DiagGmmNormal; does not resize. More... | |
DiagGmm (int32 nMix, int32 dim) | |
DiagGmm (const std::vector< std::pair< BaseFloat, const DiagGmm *> > &gmms) | |
Constructor that allows us to merge GMMs with weights. More... | |
void | Resize (int32 nMix, int32 dim) |
Resizes arrays to this dim. Does not initialize data. More... | |
int32 | NumGauss () const |
Returns the number of mixture components in the GMM. More... | |
int32 | Dim () const |
Returns the dimensionality of the Gaussian mean vectors. More... | |
void | CopyFromDiagGmm (const DiagGmm &diaggmm) |
Copies from given DiagGmm. More... | |
void | CopyFromFullGmm (const FullGmm &fullgmm) |
Copies from given FullGmm. More... | |
BaseFloat | LogLikelihood (const VectorBase< BaseFloat > &data) const |
Returns the log-likelihood of a data point (vector) given the GMM. More... | |
void | LogLikelihoods (const VectorBase< BaseFloat > &data, Vector< BaseFloat > *loglikes) const |
Outputs the per-component log-likelihoods. More... | |
void | LogLikelihoods (const MatrixBase< BaseFloat > &data, Matrix< BaseFloat > *loglikes) const |
This version of the LogLikelihoods function operates on a sequence of frames simultaneously; the row index of both "data" and "loglikes" is the frame index. More... | |
void | LogLikelihoodsPreselect (const VectorBase< BaseFloat > &data, const std::vector< int32 > &indices, Vector< BaseFloat > *loglikes) const |
Outputs the per-component log-likelihoods of a subset of mixture components. More... | |
BaseFloat | GaussianSelection (const VectorBase< BaseFloat > &data, int32 num_gselect, std::vector< int32 > *output) const |
Get gaussian selection information for one frame. More... | |
BaseFloat | GaussianSelection (const MatrixBase< BaseFloat > &data, int32 num_gselect, std::vector< std::vector< int32 > > *output) const |
This version of the Gaussian selection function works for a sequence of frames rather than just a single frame. More... | |
BaseFloat | GaussianSelectionPreselect (const VectorBase< BaseFloat > &data, const std::vector< int32 > &preselect, int32 num_gselect, std::vector< int32 > *output) const |
Get gaussian selection information for one frame. More... | |
BaseFloat | ComponentPosteriors (const VectorBase< BaseFloat > &data, Vector< BaseFloat > *posteriors) const |
Computes the posterior probabilities of all Gaussian components given a data point. More... | |
BaseFloat | ComponentLogLikelihood (const VectorBase< BaseFloat > &data, int32 comp_id) const |
Computes the log-likelihood of a data point given a single Gaussian component. More... | |
int32 | ComputeGconsts () |
Sets the gconsts. More... | |
void | Generate (VectorBase< BaseFloat > *output) |
Generates a random data-point from this distribution. More... | |
void | Split (int32 target_components, float perturb_factor, std::vector< int32 > *history=NULL) |
Split the components and remember the order in which the components were split. More... | |
void | Perturb (float perturb_factor) |
Perturbs the component means with a random vector multiplied by the pertrub factor. More... | |
void | Merge (int32 target_components, std::vector< int32 > *history=NULL) |
Merge the components and remember the order in which the components were merged (flat list of pairs) More... | |
void | MergeKmeans (int32 target_components, ClusterKMeansOptions cfg=ClusterKMeansOptions()) |
void | Write (std::ostream &os, bool binary) const |
void | Read (std::istream &in, bool binary) |
void | Interpolate (BaseFloat rho, const DiagGmm &source, GmmFlagsType flags=kGmmAll) |
this = rho x source + (1-rho) x this More... | |
void | Interpolate (BaseFloat rho, const FullGmm &source, GmmFlagsType flags=kGmmAll) |
this = rho x source + (1-rho) x this More... | |
const Vector< BaseFloat > & | gconsts () const |
Const accessors. More... | |
const Vector< BaseFloat > & | weights () const |
const Matrix< BaseFloat > & | means_invvars () const |
const Matrix< BaseFloat > & | inv_vars () const |
bool | valid_gconsts () const |
void | RemoveComponent (int32 gauss, bool renorm_weights) |
Removes single component from model. More... | |
void | RemoveComponents (const std::vector< int32 > &gauss, bool renorm_weights) |
Removes multiple components from model; "gauss" must not have dups. More... | |
template<class Real > | |
void | SetWeights (const VectorBase< Real > &w) |
Mutators for both float or double. More... | |
template<class Real > | |
void | SetMeans (const MatrixBase< Real > &m) |
Use SetMeans to update only the Gaussian means (and not variances) More... | |
template<class Real > | |
void | SetInvVarsAndMeans (const MatrixBase< Real > &invvars, const MatrixBase< Real > &means) |
Use SetInvVarsAndMeans if updating both means and (inverse) variances. More... | |
template<class Real > | |
void | SetInvVars (const MatrixBase< Real > &v) |
Set the (inverse) variances and recompute means_invvars_. More... | |
template<class Real > | |
void | GetVars (Matrix< Real > *v) const |
Accessor for covariances. More... | |
template<class Real > | |
void | GetMeans (Matrix< Real > *m) const |
Accessor for means. More... | |
template<class Real > | |
void | SetComponentMean (int32 gauss, const VectorBase< Real > &in) |
Mutators for single component, supports float or double Set mean for a single component - internally multiplies with inv(var) More... | |
template<class Real > | |
void | SetComponentInvVar (int32 gauss, const VectorBase< Real > &in) |
Set inv-var for single component (recommend to do this before setting the mean, if doing both, for numerical reasons). More... | |
void | SetComponentWeight (int32 gauss, BaseFloat weight) |
Set weight for single component. More... | |
template<class Real > | |
void | GetComponentMean (int32 gauss, VectorBase< Real > *out) const |
Accessor for single component mean. More... | |
template<class Real > | |
void | GetComponentVariance (int32 gauss, VectorBase< Real > *out) const |
Accessor for single component variance. More... | |
Private Member Functions | |
BaseFloat | merged_components_logdet (BaseFloat w1, BaseFloat w2, const VectorBase< BaseFloat > &f1, const VectorBase< BaseFloat > &f2, const VectorBase< BaseFloat > &s1, const VectorBase< BaseFloat > &s2) const |
const DiagGmm & | operator= (const DiagGmm &other) |
Private Attributes | |
Vector< BaseFloat > | gconsts_ |
Equals log(weight) - 0.5 * (log det(var) + mean*mean*inv(var)) More... | |
bool | valid_gconsts_ |
Recompute gconsts_ if false. More... | |
Vector< BaseFloat > | weights_ |
weights (not log). More... | |
Matrix< BaseFloat > | inv_vars_ |
Inverted (diagonal) variances. More... | |
Matrix< BaseFloat > | means_invvars_ |
Means times inverted variance. More... | |
Friends | |
class | DiagGmmNormal |
this makes it a little easier to modify the internals More... | |
Definition for Gaussian Mixture Model with diagonal covariances.
Definition at line 42 of file diag-gmm.h.
|
inline |
Empty constructor.
Definition at line 48 of file diag-gmm.h.
Referenced by DiagGmm::DiagGmm(), and DiagGmm::Split().
Definition at line 50 of file diag-gmm.h.
References DiagGmm::CopyFromDiagGmm(), DiagGmm::CopyFromNormal(), and DiagGmm::DiagGmm().
DiagGmm | ( | const GaussClusterable & | gc, |
BaseFloat | var_floor | ||
) |
Initializer from GaussClusterable initializes the DiagGmm as a single Gaussian from tree stats.
Definition at line 944 of file diag-gmm.cc.
References DiagGmm::ComputeGconsts(), count, GaussClusterable::count(), KALDI_ASSERT, DiagGmm::Resize(), MatrixBase< Real >::Row(), DiagGmm::SetInvVarsAndMeans(), DiagGmm::SetWeights(), DiagGmm::weights(), GaussClusterable::x2_stats(), and GaussClusterable::x_stats().
Definition at line 61 of file diag-gmm.h.
References DiagGmm::DiagGmm(), and DiagGmm::Resize().
Constructor that allows us to merge GMMs with weights.
Weights must sum to one, or this GMM will not be properly normalized (we don't check this). Weights must be positive (we check this).
Definition at line 39 of file diag-gmm.cc.
References DiagGmm::ComputeGconsts(), rnnlm::i, DiagGmm::inv_vars(), DiagGmm::inv_vars_, KALDI_ASSERT, DiagGmm::means_invvars(), DiagGmm::means_invvars_, DiagGmm::NumGauss(), DiagGmm::Resize(), MatrixBase< Real >::Row(), DiagGmm::weights(), and DiagGmm::weights_.
BaseFloat ComponentLogLikelihood | ( | const VectorBase< BaseFloat > & | data, |
int32 | comp_id | ||
) | const |
Computes the log-likelihood of a data point given a single Gaussian component.
NOTE: Currently we make no guarantees about what happens if one of the variances is zero.
Definition at line 497 of file diag-gmm.cc.
References VectorBase< Real >::ApplyPow(), VectorBase< Real >::Dim(), DiagGmm::Dim(), DiagGmm::gconsts_, DiagGmm::inv_vars_, KALDI_ERR, DiagGmm::means_invvars_, MatrixBase< Real >::Row(), DiagGmm::valid_gconsts_, and kaldi::VecVec().
Referenced by DiagGmm::Dim().
BaseFloat ComponentPosteriors | ( | const VectorBase< BaseFloat > & | data, |
Vector< BaseFloat > * | posteriors | ||
) | const |
Computes the posterior probabilities of all Gaussian components given a data point.
Returns the log-likehood of the data given the GMM.
Definition at line 601 of file diag-gmm.cc.
References VectorBase< Real >::ApplySoftMax(), VectorBase< Real >::CopyFromVec(), VectorBase< Real >::Dim(), KALDI_ERR, KALDI_ISINF, KALDI_ISNAN, DiagGmm::LogLikelihoods(), Vector< Real >::Resize(), and DiagGmm::valid_gconsts_.
Referenced by FmllrDiagGmmAccs::AccumulateForGmm(), FmllrRawAccs::AccumulateForGmm(), RegtreeMllrDiagGmmAccs::AccumulateForGmm(), RegtreeFmllrDiagGmmAccs::AccumulateForGmm(), AccumFullGmm::AccumulateFromDiag(), AccumDiagGmm::AccumulateFromDiag(), MlltAccs::AccumulateFromGmm(), kaldi::ComputeAmGmmFeatureDeriv(), DiagGmm::Dim(), kaldi::GetFeatDeriv(), SingleUtteranceGmmDecoder::GetGaussianPosteriors(), main(), TestComponentAcc(), kaldi::UnitTestDiagGmm(), kaldi::UnitTestFmllrDiagGmm(), kaldi::UnitTestFmllrDiagGmmDiagonal(), and kaldi::UnitTestFmllrDiagGmmOffset().
int32 ComputeGconsts | ( | ) |
Sets the gconsts.
Returns the number that are "invalid" e.g. because of zero weights or variances.
Definition at line 114 of file diag-gmm.cc.
References rnnlm::d, DiagGmm::Dim(), DiagGmm::gconsts_, DiagGmm::inv_vars_, KALDI_ASSERT, KALDI_ERR, KALDI_ISINF, KALDI_ISNAN, kaldi::Log(), M_LOG_2PI, DiagGmm::means_invvars_, DiagGmm::NumGauss(), DiagGmm::valid_gconsts_, and DiagGmm::weights_.
Referenced by Sgmm2Project::ApplyProjection(), DiagGmm::CopyFromFullGmm(), DiagGmm::DiagGmm(), DiagGmm::Dim(), init_rand_diag_gmm(), kaldi::InitGmmFromRandomFrames(), kaldi::unittest::InitRandDiagGmm(), kaldi::InitRandomGmm(), DiagGmm::Interpolate(), main(), kaldi::MapDiagGmmUpdate(), DiagGmm::Merge(), DiagGmm::MergeKmeans(), kaldi::MleDiagGmmUpdate(), DiagGmm::Perturb(), rand_diag_gmm(), DiagGmm::Read(), kaldi::ResizeModel(), DiagGmm::Split(), test_flags_driven_update(), TestXformMean(), kaldi::UnitTestDiagGmm(), UnitTestEstimateDiagGmm(), kaldi::UnitTestEstimateMmieDiagGmm(), kaldi::UnitTestRegtreeFmllrDiagGmm(), kaldi::UpdateEbwDiagGmm(), and kaldi::UpdateEbwWeightsDiagGmm().
void CopyFromDiagGmm | ( | const DiagGmm & | diaggmm | ) |
Copies from given DiagGmm.
Definition at line 83 of file diag-gmm.cc.
References MatrixBase< Real >::CopyFromMat(), DiagGmm::gconsts_, DiagGmm::inv_vars_, DiagGmm::means_invvars_, MatrixBase< Real >::NumCols(), DiagGmm::Resize(), DiagGmm::valid_gconsts_, and DiagGmm::weights_.
Referenced by AmDiagGmm::AddPdf(), kaldi::ClusterGaussiansToUbm(), DiagGmm::DiagGmm(), DiagGmm::Dim(), DiagGmm::Split(), test_flags_driven_update(), test_io(), TestXformMean(), kaldi::UnitTestDiagGmm(), and UnitTestRegressionTree().
void CopyFromFullGmm | ( | const FullGmm & | fullgmm | ) |
Copies from given FullGmm.
Definition at line 92 of file diag-gmm.cc.
References DiagGmm::ComputeGconsts(), VectorBase< Real >::CopyDiagFromPacked(), MatrixBase< Real >::CopyFromMat(), SpMatrix< Real >::CopyFromSp(), kaldi::diag, FullGmm::Dim(), FullGmm::gconsts(), DiagGmm::gconsts_, FullGmm::GetMeans(), FullGmm::inv_covars(), DiagGmm::inv_vars_, SpMatrix< Real >::Invert(), VectorBase< Real >::InvertElements(), DiagGmm::means_invvars_, MatrixBase< Real >::MulElements(), FullGmm::NumGauss(), DiagGmm::NumGauss(), DiagGmm::Resize(), MatrixBase< Real >::Row(), FullGmm::weights(), and DiagGmm::weights_.
Referenced by Sgmm2Project::ApplyProjection(), DiagGmm::Dim(), main(), and UnitTestFullGmm().
void CopyFromNormal | ( | const DiagGmmNormal & | diag_gmm_normal | ) |
Copies from DiagGmmNormal; does not resize.
Definition at line 918 of file diag-gmm.cc.
References DiagGmmNormal::CopyToDiagGmm().
Referenced by DiagGmm::DiagGmm(), and kaldi::InitGmmFromRandomFrames().
|
inline |
Returns the dimensionality of the Gaussian mean vectors.
Definition at line 74 of file diag-gmm.h.
References DiagGmm::ComponentLogLikelihood(), DiagGmm::ComponentPosteriors(), DiagGmm::ComputeGconsts(), DiagGmm::CopyFromDiagGmm(), DiagGmm::CopyFromFullGmm(), DiagGmm::GaussianSelection(), DiagGmm::GaussianSelectionPreselect(), DiagGmm::Generate(), DiagGmm::Interpolate(), kaldi::kGmmAll, DiagGmm::LogLikelihood(), DiagGmm::LogLikelihoods(), DiagGmm::LogLikelihoodsPreselect(), DiagGmm::means_invvars_, DiagGmm::Merge(), DiagGmm::MergeKmeans(), MatrixBase< Real >::NumCols(), DiagGmm::Perturb(), DiagGmm::Read(), DiagGmm::Split(), and DiagGmm::Write().
Referenced by AccumFullGmm::AccumulateFromDiag(), AccumDiagGmm::AccumulateFromDiag(), MlltAccs::AccumulateFromPosteriors(), AmDiagGmm::AddPdf(), OnlineIvectorExtractionInfo::Check(), DiagGmm::ComponentLogLikelihood(), Fmpe::ComputeC(), DiagGmm::ComputeGconsts(), DiagGmmNormal::CopyFromDiagGmm(), FullGmm::CopyFromDiagGmm(), DiagGmmNormal::CopyToDiagGmm(), kaldi::DiagGmmToStats(), kaldi::DoRescalingUpdate(), FmllrDiagGmmAccs::FmllrDiagGmmAccs(), DiagGmm::Generate(), DiagGmm::GetComponentMean(), DiagGmm::GetComponentVariance(), DiagGmm::GetMeans(), kaldi::GetStatsDerivative(), DiagGmm::GetVars(), init_rand_diag_gmm(), DiagGmm::Interpolate(), DiagGmm::LogLikelihoods(), DiagGmm::LogLikelihoodsPreselect(), DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased(), DecodableAmDiagGmmUnmapped::LogLikelihoodZeroBased(), DecodableAmDiagGmmRegtreeMllr::LogLikelihoodZeroBased(), main(), kaldi::MapDiagGmmUpdate(), DiagGmm::Merge(), DiagGmm::MergeKmeans(), kaldi::MleDiagGmmUpdate(), DiagGmm::Perturb(), AccumDiagGmm::Resize(), DiagGmm::SetComponentInvVar(), DiagGmm::SetComponentMean(), DiagGmm::SetInvVars(), AccumDiagGmm::SmoothWithModel(), DiagGmm::Split(), test_flags_driven_update(), TestComponentAcc(), kaldi::UnitTestDiagGmm(), kaldi::UnitTestDiagGmmGenerate(), UnitTestEstimateDiagGmm(), kaldi::UnitTestEstimateMmieDiagGmm(), kaldi::UnitTestFmllrDiagGmm(), kaldi::UnitTestFmllrDiagGmmDiagonal(), kaldi::UnitTestFmllrDiagGmmOffset(), kaldi::UnitTestFmllrRaw(), and kaldi::UpdateEbwDiagGmm().
BaseFloat GaussianSelection | ( | const VectorBase< BaseFloat > & | data, |
int32 | num_gselect, | ||
std::vector< int32 > * | output | ||
) | const |
Get gaussian selection information for one frame.
Returns log-like this frame. Output is the best "num_gselect" indices, sorted from best to worst likelihood. If "num_gselect" > NumGauss(), sets it to NumGauss().
Definition at line 765 of file diag-gmm.cc.
References VectorBase< Real >::Data(), rnnlm::j, KALDI_ASSERT, kaldi::kUndefined, kaldi::LogAdd(), DiagGmm::LogLikelihoods(), and DiagGmm::NumGauss().
Referenced by DiagGmm::Dim(), DiagGmm::GaussianSelection(), and main().
BaseFloat GaussianSelection | ( | const MatrixBase< BaseFloat > & | data, |
int32 | num_gselect, | ||
std::vector< std::vector< int32 > > * | output | ||
) | const |
This version of the Gaussian selection function works for a sequence of frames rather than just a single frame.
Returns sum of the log-likes over all frames.
Definition at line 801 of file diag-gmm.cc.
References VectorBase< Real >::Data(), DiagGmm::GaussianSelection(), rnnlm::i, rnnlm::j, KALDI_ASSERT, kaldi::kUndefined, kaldi::LogAdd(), DiagGmm::LogLikelihoods(), MatrixBase< Real >::NumCols(), DiagGmm::NumGauss(), and MatrixBase< Real >::NumRows().
BaseFloat GaussianSelectionPreselect | ( | const VectorBase< BaseFloat > & | data, |
const std::vector< int32 > & | preselect, | ||
int32 | num_gselect, | ||
std::vector< int32 > * | output | ||
) | const |
Get gaussian selection information for one frame.
Returns log-like for this frame. Output is the best "num_gselect" indices that were preselected, sorted from best to worst likelihood. If "num_gselect" > NumGauss(), sets it to NumGauss().
Definition at line 875 of file diag-gmm.cc.
References VectorBase< Real >::Data(), rnnlm::j, KALDI_ASSERT, KALDI_WARN, kaldi::LogAdd(), and DiagGmm::LogLikelihoodsPreselect().
Referenced by DiagGmm::Dim(), and main().
Const accessors.
Definition at line 174 of file diag-gmm.h.
References DiagGmm::gconsts_, KALDI_ASSERT, and DiagGmm::valid_gconsts_.
Referenced by FullGmm::CopyFromDiagGmm(), DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased(), DecodableAmDiagGmmUnmapped::LogLikelihoodZeroBased(), and kaldi::MlObjective().
void Generate | ( | VectorBase< BaseFloat > * | output | ) |
Generates a random data-point from this distribution.
Definition at line 922 of file diag-gmm.cc.
References rnnlm::d, VectorBase< Real >::Dim(), DiagGmm::Dim(), rnnlm::i, DiagGmm::inv_vars_, KALDI_ASSERT, DiagGmm::means_invvars_, kaldi::RandGauss(), kaldi::RandUniform(), and DiagGmm::weights_.
Referenced by DiagGmm::Dim(), TestMllrAccsIO(), kaldi::UnitTestDiagGmmGenerate(), kaldi::UnitTestFmllrDiagGmm(), kaldi::UnitTestFmllrDiagGmmDiagonal(), kaldi::UnitTestFmllrDiagGmmOffset(), and UnitTestRegtreeMllrDiagGmm().
void GetComponentMean | ( | int32 | gauss, |
VectorBase< Real > * | out | ||
) | const |
Accessor for single component mean.
Definition at line 135 of file diag-gmm-inl.h.
References VectorBase< Real >::CopyRowFromMat(), VectorBase< Real >::Dim(), DiagGmm::Dim(), VectorBase< Real >::DivElements(), DiagGmm::inv_vars_, KALDI_ASSERT, DiagGmm::means_invvars_, and DiagGmm::NumGauss().
Referenced by RegtreeMllrDiagGmmAccs::AccumulateForGaussian(), RegtreeMllrDiagGmmAccs::AccumulateForGmm(), kaldi::ClusterGaussiansToUbm(), kaldi::UnitTestDiagGmm(), UnitTestRegressionTree(), and DiagGmm::valid_gconsts().
void GetComponentVariance | ( | int32 | gauss, |
VectorBase< Real > * | out | ||
) | const |
Accessor for single component variance.
Definition at line 145 of file diag-gmm-inl.h.
References VectorBase< Real >::CopyRowFromMat(), VectorBase< Real >::Dim(), DiagGmm::Dim(), DiagGmm::inv_vars_, VectorBase< Real >::InvertElements(), KALDI_ASSERT, and DiagGmm::NumGauss().
Referenced by kaldi::ClusterGaussiansToUbm(), and DiagGmm::valid_gconsts().
void GetMeans | ( | Matrix< Real > * | m | ) | const |
Accessor for means.
Definition at line 123 of file diag-gmm-inl.h.
References MatrixBase< Real >::CopyFromMat(), DiagGmm::Dim(), DiagGmm::inv_vars_, MatrixBase< Real >::InvertElements(), KALDI_ASSERT, DiagGmm::means_invvars_, MatrixBase< Real >::MulElements(), DiagGmm::NumGauss(), and Matrix< Real >::Resize().
Referenced by BasisFmllrEstimate::ComputeAmDiagPrecond(), main(), AccumDiagGmm::SmoothWithModel(), test_flags_driven_update(), kaldi::UnitTestDiagGmm(), UnitTestRegressionTree(), and DiagGmm::valid_gconsts().
void GetVars | ( | Matrix< Real > * | v | ) | const |
Accessor for covariances.
Definition at line 115 of file diag-gmm-inl.h.
References MatrixBase< Real >::CopyFromMat(), DiagGmm::Dim(), DiagGmm::inv_vars_, MatrixBase< Real >::InvertElements(), KALDI_ASSERT, DiagGmm::NumGauss(), and Matrix< Real >::Resize().
Referenced by BasisFmllrEstimate::ComputeAmDiagPrecond(), AccumDiagGmm::SmoothWithModel(), test_flags_driven_update(), kaldi::UnitTestDiagGmm(), and DiagGmm::valid_gconsts().
void Interpolate | ( | BaseFloat | rho, |
const DiagGmm & | source, | ||
GmmFlagsType | flags = kGmmAll |
||
) |
this = rho x source + (1-rho) x this
Definition at line 645 of file diag-gmm.cc.
References DiagGmm::ComputeGconsts(), DiagGmm::Dim(), KALDI_ASSERT, kaldi::kGmmMeans, kaldi::kGmmVariances, kaldi::kGmmWeights, DiagGmmNormal::means_, DiagGmm::NumGauss(), DiagGmmNormal::vars_, and DiagGmmNormal::weights_.
Referenced by DiagGmm::Dim().
void Interpolate | ( | BaseFloat | rho, |
const FullGmm & | source, | ||
GmmFlagsType | flags = kGmmAll |
||
) |
this = rho x source + (1-rho) x this
Definition at line 673 of file diag-gmm.cc.
References DiagGmm::ComputeGconsts(), kaldi::diag, FullGmm::Dim(), DiagGmm::Dim(), rnnlm::i, rnnlm::j, KALDI_ASSERT, kaldi::kGmmMeans, kaldi::kGmmVariances, kaldi::kGmmWeights, FullGmmNormal::means_, FullGmm::NumGauss(), DiagGmm::NumGauss(), FullGmmNormal::vars_, and FullGmmNormal::weights_.
Definition at line 180 of file diag-gmm.h.
References DiagGmm::inv_vars_.
Referenced by RegtreeMllrDiagGmmAccs::AccumulateForGaussian(), RegtreeFmllrDiagGmmAccs::AccumulateForGaussian(), RegtreeMllrDiagGmmAccs::AccumulateForGmm(), RegtreeFmllrDiagGmmAccs::AccumulateForGmm(), MlltAccs::AccumulateFromPosteriors(), FmllrDiagGmmAccs::AccumulateFromPosteriors(), FmllrRawAccs::AccumulateFromPosteriors(), FmllrDiagGmmAccs::AccumulateFromPosteriorsPreselect(), kaldi::ComputeAmGmmFeatureDeriv(), Fmpe::ComputeStddevs(), FullGmm::CopyFromDiagGmm(), DiagGmm::DiagGmm(), FmllrDiagGmmAccs::FmllrDiagGmmAccs(), kaldi::GetFeatDeriv(), DecodableAmDiagGmmRegtreeMllr::GetXformedMeanInvVars(), DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased(), DecodableAmDiagGmmUnmapped::LogLikelihoodZeroBased(), DecodableAmDiagGmmRegtreeMllr::LogLikelihoodZeroBased(), kaldi::MlObjective(), TestXformMean(), and UnitTestEstimateDiagGmm().
BaseFloat LogLikelihood | ( | const VectorBase< BaseFloat > & | data | ) | const |
Returns the log-likelihood of a data point (vector) given the GMM.
Definition at line 517 of file diag-gmm.cc.
References KALDI_ERR, KALDI_ISINF, KALDI_ISNAN, DiagGmm::LogLikelihoods(), VectorBase< Real >::LogSumExp(), and DiagGmm::valid_gconsts_.
Referenced by DiagGmm::Dim(), kaldi::GetGmmLike(), main(), test_flags_driven_update(), test_io(), TestComponentAcc(), TestXformMean(), kaldi::UnitTestDiagGmm(), and UnitTestFullGmm().
void LogLikelihoods | ( | const VectorBase< BaseFloat > & | data, |
Vector< BaseFloat > * | loglikes | ||
) | const |
Outputs the per-component log-likelihoods.
Definition at line 528 of file diag-gmm.cc.
References VectorBase< Real >::AddMatVec(), VectorBase< Real >::ApplyPow(), VectorBase< Real >::CopyFromVec(), VectorBase< Real >::Dim(), DiagGmm::Dim(), DiagGmm::gconsts_, DiagGmm::inv_vars_, KALDI_ERR, kaldi::kNoTrans, kaldi::kUndefined, DiagGmm::means_invvars_, and Vector< Real >::Resize().
Referenced by DiagGmm::ComponentPosteriors(), DiagGmm::Dim(), DiagGmm::GaussianSelection(), DiagGmm::LogLikelihood(), main(), and kaldi::UnitTestDiagGmm().
void LogLikelihoods | ( | const MatrixBase< BaseFloat > & | data, |
Matrix< BaseFloat > * | loglikes | ||
) | const |
This version of the LogLikelihoods function operates on a sequence of frames simultaneously; the row index of both "data" and "loglikes" is the frame index.
Definition at line 546 of file diag-gmm.cc.
References MatrixBase< Real >::AddMatMat(), MatrixBase< Real >::ApplyPow(), MatrixBase< Real >::CopyRowsFromVec(), DiagGmm::Dim(), DiagGmm::gconsts_, DiagGmm::inv_vars_, KALDI_ASSERT, KALDI_ERR, kaldi::kNoTrans, kaldi::kTrans, kaldi::kUndefined, DiagGmm::means_invvars_, MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), and Matrix< Real >::Resize().
void LogLikelihoodsPreselect | ( | const VectorBase< BaseFloat > & | data, |
const std::vector< int32 > & | indices, | ||
Vector< BaseFloat > * | loglikes | ||
) | const |
Outputs the per-component log-likelihoods of a subset of mixture components.
Note: at output, loglikes->Dim() will equal indices.size(). loglikes[i] will correspond to the log-likelihood of the Gaussian indexed indices[i], including the mixture weight.
Definition at line 566 of file diag-gmm.cc.
References VectorBase< Real >::AddMatVec(), VectorBase< Real >::CopyFromVec(), VectorBase< Real >::Dim(), DiagGmm::Dim(), DiagGmm::gconsts_, rnnlm::i, DiagGmm::inv_vars_, KALDI_ASSERT, kaldi::kNoTrans, kaldi::kUndefined, DiagGmm::means_invvars_, Vector< Real >::Resize(), MatrixBase< Real >::Row(), and kaldi::VecVec().
Referenced by FmllrDiagGmmAccs::AccumulateForGmmPreselect(), kaldi::AccumulateForUtterance(), MlltAccs::AccumulateFromGmmPreselect(), Fmpe::ApplyProjection(), Fmpe::ApplyProjectionReverse(), DiagGmm::Dim(), DiagGmm::GaussianSelectionPreselect(), main(), and kaldi::UnitTestDiagGmm().
Definition at line 179 of file diag-gmm.h.
References DiagGmm::means_invvars_.
Referenced by RegtreeFmllrDiagGmmAccs::AccumulateForGaussian(), RegtreeFmllrDiagGmmAccs::AccumulateForGmm(), MlltAccs::AccumulateFromPosteriors(), FmllrDiagGmmAccs::AccumulateFromPosteriors(), FmllrRawAccs::AccumulateFromPosteriors(), FmllrDiagGmmAccs::AccumulateFromPosteriorsPreselect(), Fmpe::ApplyProjection(), Fmpe::ApplyProjectionReverse(), kaldi::ComputeAmGmmFeatureDeriv(), FullGmm::CopyFromDiagGmm(), DiagGmm::DiagGmm(), FmllrDiagGmmAccs::FmllrDiagGmmAccs(), kaldi::GetFeatDeriv(), DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased(), DecodableAmDiagGmmUnmapped::LogLikelihoodZeroBased(), kaldi::MlObjective(), and UnitTestEstimateDiagGmm().
Merge the components and remember the order in which the components were merged (flat list of pairs)
Definition at line 295 of file diag-gmm.cc.
References kaldi::ApproxEqual(), DiagGmm::ComputeGconsts(), rnnlm::d, DiagGmm::Dim(), DiagGmm::gconsts_, rnnlm::i, DiagGmm::inv_vars_, MatrixBase< Real >::InvertElements(), rnnlm::j, KALDI_ASSERT, KALDI_ERR, KALDI_VLOG, KALDI_WARN, kaldi::Log(), DiagGmm::means_invvars_, DiagGmm::merged_components_logdet(), MatrixBase< Real >::MulElements(), DiagGmm::NumGauss(), Matrix< Real >::RemoveRow(), Matrix< Real >::Resize(), MatrixBase< Real >::Row(), MatrixBase< Real >::Scale(), DiagGmm::weights(), and DiagGmm::weights_.
Referenced by kaldi::ClusterGaussiansToUbm(), DiagGmm::Dim(), and kaldi::UnitTestDiagGmm().
|
private |
Definition at line 471 of file diag-gmm.cc.
References VectorBase< Real >::AddVec(), VectorBase< Real >::AddVec2(), VectorBase< Real >::CopyFromVec(), rnnlm::d, VectorBase< Real >::Dim(), kaldi::Log(), and VectorBase< Real >::Scale().
Referenced by DiagGmm::Merge().
void MergeKmeans | ( | int32 | target_components, |
ClusterKMeansOptions | cfg = ClusterKMeansOptions() |
||
) |
Definition at line 231 of file diag-gmm.cc.
References VectorBase< Real >::AddVec2(), kaldi::ClusterKMeans(), DiagGmm::ComputeGconsts(), VectorBase< Real >::CopyFromVec(), count, GaussClusterable::count(), kaldi::DeletePointers(), DiagGmm::Dim(), DiagGmm::inv_vars_, VectorBase< Real >::InvertElements(), KALDI_ERR, KALDI_VLOG, KALDI_WARN, DiagGmm::means_invvars_, VectorBase< Real >::MulElements(), DiagGmm::NumGauss(), DiagGmm::Resize(), VectorBase< Real >::Scale(), DiagGmm::weights_, GaussClusterable::x2_stats(), and GaussClusterable::x_stats().
Referenced by DiagGmm::Dim(), and kaldi::UnitTestDiagGmm().
|
inline |
Returns the number of mixture components in the GMM.
Definition at line 72 of file diag-gmm.h.
References DiagGmm::weights_.
Referenced by AccumAmDiagGmm::AccumulateForGaussian(), FmllrDiagGmmAccs::AccumulateForGmm(), FmllrRawAccs::AccumulateForGmm(), RegtreeMllrDiagGmmAccs::AccumulateForGmm(), RegtreeFmllrDiagGmmAccs::AccumulateForGmm(), AccumFullGmm::AccumulateFromDiag(), AccumDiagGmm::AccumulateFromDiag(), MlltAccs::AccumulateFromGmm(), MlltAccs::AccumulateFromGmmPreselect(), MlltAccs::AccumulateFromPosteriors(), FmllrRawAccs::AccumulateFromPosteriors(), RegressionTree::BuildTree(), kaldi::ClusterGaussiansToUbm(), BasisFmllrEstimate::ComputeAmDiagPrecond(), Fmpe::ComputeC(), DiagGmm::ComputeGconsts(), FullGmm::CopyFromDiagGmm(), DiagGmm::CopyFromFullGmm(), DiagGmm::DiagGmm(), kaldi::DiagGmmToStats(), kaldi::DoRescalingUpdate(), FmllrDiagGmmAccs::FmllrDiagGmmAccs(), DiagGmm::GaussianSelection(), DiagGmm::GetComponentMean(), DiagGmm::GetComponentVariance(), DiagGmm::GetMeans(), kaldi::GetStatsDerivative(), RegtreeMllrDiagGmm::GetTransformedMeans(), DiagGmm::GetVars(), DecodableAmDiagGmmRegtreeMllr::GetXformedMeanInvVars(), AccumAmDiagGmm::Init(), init_rand_diag_gmm(), kaldi::InitGmmFromRandomFrames(), DiagGmm::Interpolate(), DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased(), main(), kaldi::MapDiagGmmUpdate(), DiagGmm::Merge(), DiagGmm::MergeKmeans(), kaldi::MleDiagGmmUpdate(), DiagGmm::Perturb(), DiagGmm::RemoveComponent(), AccumDiagGmm::Resize(), kaldi::ResizeModel(), DiagGmm::SetComponentInvVar(), DiagGmm::SetComponentMean(), DiagGmm::SetComponentWeight(), DiagGmm::SetInvVars(), AccumDiagGmm::SmoothWithModel(), DiagGmm::Split(), test_flags_driven_update(), TestComponentAcc(), kaldi::TestFmpe(), TestXformMean(), kaldi::UnitTestDiagGmm(), kaldi::UnitTestDiagGmmGenerate(), UnitTestEstimateDiagGmm(), kaldi::UnitTestEstimateMmieDiagGmm(), kaldi::UnitTestFmllrDiagGmm(), kaldi::UnitTestFmllrDiagGmmDiagonal(), kaldi::UnitTestFmllrDiagGmmOffset(), UnitTestRegressionTree(), kaldi::UpdateEbwDiagGmm(), and Fmpe::Write().
void Perturb | ( | float | perturb_factor | ) |
Perturbs the component means with a random vector multiplied by the pertrub factor.
Definition at line 215 of file diag-gmm.cc.
References MatrixBase< Real >::AddMat(), DiagGmm::ComputeGconsts(), rnnlm::d, DiagGmm::Dim(), rnnlm::i, DiagGmm::inv_vars_, kaldi::kNoTrans, DiagGmm::means_invvars_, DiagGmm::NumGauss(), and kaldi::RandGauss().
Referenced by DiagGmm::Dim(), init_rand_diag_gmm(), kaldi::InitRandomGmm(), and main().
void Read | ( | std::istream & | in, |
bool | binary | ||
) |
Definition at line 728 of file diag-gmm.cc.
References DiagGmm::ComputeGconsts(), kaldi::ExpectToken(), DiagGmm::gconsts_, DiagGmm::inv_vars_, KALDI_ERR, DiagGmm::means_invvars_, Matrix< Real >::Read(), kaldi::ReadToken(), and DiagGmm::weights_.
Referenced by DiagGmm::Dim(), main(), kaldi::operator>>(), Fmpe::Read(), and kaldi::UnitTestDiagGmm().
Removes single component from model.
Definition at line 617 of file diag-gmm.cc.
References DiagGmm::gconsts_, DiagGmm::inv_vars_, KALDI_ASSERT, KALDI_ERR, DiagGmm::means_invvars_, DiagGmm::NumGauss(), Matrix< Real >::RemoveRow(), DiagGmm::valid_gconsts_, and DiagGmm::weights_.
Referenced by DiagGmm::RemoveComponents(), and DiagGmm::valid_gconsts().
Removes multiple components from model; "gauss" must not have dups.
Definition at line 632 of file diag-gmm.cc.
References rnnlm::i, kaldi::IsSortedAndUniq(), rnnlm::j, KALDI_ASSERT, and DiagGmm::RemoveComponent().
Referenced by kaldi::MleDiagGmmUpdate(), and DiagGmm::valid_gconsts().
Resizes arrays to this dim. Does not initialize data.
Definition at line 66 of file diag-gmm.cc.
References DiagGmm::gconsts_, DiagGmm::inv_vars_, KALDI_ASSERT, DiagGmm::means_invvars_, MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), Matrix< Real >::Resize(), MatrixBase< Real >::Set(), DiagGmm::valid_gconsts_, and DiagGmm::weights_.
Referenced by Sgmm2Project::ApplyProjection(), kaldi::ClusterGaussiansToUbm(), DiagGmm::CopyFromDiagGmm(), DiagGmm::CopyFromFullGmm(), DiagGmm::DiagGmm(), kaldi::unittest::InitRandDiagGmm(), kaldi::InitRandomGmm(), main(), DiagGmm::MergeKmeans(), kaldi::ResizeModel(), TestComponentAcc(), kaldi::UnitTestDiagGmm(), UnitTestEstimateDiagGmm(), kaldi::UnitTestEstimateMmieDiagGmm(), UnitTestFullGmm(), UnitTestRegressionTree(), and kaldi::UnitTestRegtreeFmllrDiagGmm().
void SetComponentInvVar | ( | int32 | gauss, |
const VectorBase< Real > & | in | ||
) |
Set inv-var for single component (recommend to do this before setting the mean, if doing both, for numerical reasons).
Definition at line 97 of file diag-gmm-inl.h.
References VectorBase< Real >::CopyFromVec(), VectorBase< Real >::Dim(), DiagGmm::Dim(), DiagGmm::inv_vars_, VectorBase< Real >::InvertElements(), KALDI_ASSERT, DiagGmm::means_invvars_, DiagGmm::NumGauss(), MatrixBase< Real >::Row(), and DiagGmm::valid_gconsts_.
Referenced by DiagGmm::valid_gconsts().
void SetComponentMean | ( | int32 | gauss, |
const VectorBase< Real > & | in | ||
) |
Mutators for single component, supports float or double Set mean for a single component - internally multiplies with inv(var)
Definition at line 52 of file diag-gmm-inl.h.
References MatrixBase< Real >::CopyRowFromVec(), VectorBase< Real >::Dim(), DiagGmm::Dim(), DiagGmm::inv_vars_, KALDI_ASSERT, DiagGmm::means_invvars_, DiagGmm::NumGauss(), and DiagGmm::valid_gconsts_.
Referenced by DiagGmm::valid_gconsts().
Set weight for single component.
Definition at line 34 of file diag-gmm-inl.h.
References KALDI_ASSERT, DiagGmm::NumGauss(), DiagGmm::valid_gconsts_, and DiagGmm::weights_.
Referenced by DiagGmm::valid_gconsts().
void SetInvVars | ( | const MatrixBase< Real > & | v | ) |
Set the (inverse) variances and recompute means_invvars_.
Definition at line 78 of file diag-gmm-inl.h.
References MatrixBase< Real >::CopyFromMat(), DiagGmm::Dim(), DiagGmm::inv_vars_, MatrixBase< Real >::InvertElements(), KALDI_ASSERT, DiagGmm::means_invvars_, MatrixBase< Real >::MulElements(), MatrixBase< Real >::NumCols(), DiagGmm::NumGauss(), MatrixBase< Real >::NumRows(), and DiagGmm::valid_gconsts_.
Referenced by kaldi::ResizeModel(), test_flags_driven_update(), kaldi::UnitTestDiagGmm(), and DiagGmm::valid_gconsts().
void SetInvVarsAndMeans | ( | const MatrixBase< Real > & | invvars, |
const MatrixBase< Real > & | means | ||
) |
Use SetInvVarsAndMeans if updating both means and (inverse) variances.
Definition at line 63 of file diag-gmm-inl.h.
References MatrixBase< Real >::CopyFromMat(), DiagGmm::inv_vars_, KALDI_ASSERT, DiagGmm::means_invvars_, MatrixBase< Real >::MulElements(), MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), and DiagGmm::valid_gconsts_.
Referenced by kaldi::ClusterGaussiansToUbm(), DiagGmm::DiagGmm(), init_rand_diag_gmm(), kaldi::unittest::InitRandDiagGmm(), kaldi::InitRandomGmm(), main(), rand_diag_gmm(), TestXformMean(), kaldi::UnitTestDiagGmm(), UnitTestEstimateDiagGmm(), kaldi::UnitTestEstimateMmieDiagGmm(), kaldi::UnitTestRegtreeFmllrDiagGmm(), and DiagGmm::valid_gconsts().
void SetMeans | ( | const MatrixBase< Real > & | m | ) |
Use SetMeans to update only the Gaussian means (and not variances)
Definition at line 43 of file diag-gmm-inl.h.
References MatrixBase< Real >::CopyFromMat(), DiagGmm::inv_vars_, KALDI_ASSERT, DiagGmm::means_invvars_, MatrixBase< Real >::MulElements(), MatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), and DiagGmm::valid_gconsts_.
Referenced by main(), test_flags_driven_update(), kaldi::UnitTestDiagGmm(), UnitTestRegressionTree(), and DiagGmm::valid_gconsts().
void SetWeights | ( | const VectorBase< Real > & | w | ) |
Mutators for both float or double.
Set mixure weights
Definition at line 28 of file diag-gmm-inl.h.
References VectorBase< Real >::Dim(), KALDI_ASSERT, DiagGmm::valid_gconsts_, and DiagGmm::weights_.
Referenced by kaldi::ClusterGaussiansToUbm(), DiagGmm::DiagGmm(), init_rand_diag_gmm(), kaldi::unittest::InitRandDiagGmm(), kaldi::InitRandomGmm(), main(), rand_diag_gmm(), test_flags_driven_update(), kaldi::UnitTestDiagGmm(), UnitTestEstimateDiagGmm(), kaldi::UnitTestEstimateMmieDiagGmm(), kaldi::UnitTestRegtreeFmllrDiagGmm(), and DiagGmm::valid_gconsts().
Split the components and remember the order in which the components were split.
Definition at line 154 of file diag-gmm.cc.
References DiagGmm::ComputeGconsts(), DiagGmm::CopyFromDiagGmm(), DiagGmm::DiagGmm(), DiagGmm::Dim(), DiagGmm::gconsts_, rnnlm::i, DiagGmm::inv_vars_, KALDI_ERR, KALDI_WARN, DiagGmm::means_invvars_, DiagGmm::NumGauss(), kaldi::RandGauss(), MatrixBase< Real >::Range(), Matrix< Real >::Resize(), MatrixBase< Real >::Row(), and DiagGmm::weights_.
Referenced by DiagGmm::Dim(), main(), kaldi::UnitTestDiagGmm(), UnitTestEstimateDiagGmm(), and kaldi::UnitTestEstimateMmieDiagGmm().
|
inline |
Definition at line 181 of file diag-gmm.h.
References DiagGmm::GetComponentMean(), DiagGmm::GetComponentVariance(), DiagGmm::GetMeans(), DiagGmm::GetVars(), DiagGmm::RemoveComponent(), DiagGmm::RemoveComponents(), DiagGmm::SetComponentInvVar(), DiagGmm::SetComponentMean(), DiagGmm::SetComponentWeight(), DiagGmm::SetInvVars(), DiagGmm::SetInvVarsAndMeans(), DiagGmm::SetMeans(), DiagGmm::SetWeights(), and DiagGmm::valid_gconsts_.
Referenced by DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased(), and DecodableAmDiagGmmUnmapped::LogLikelihoodZeroBased().
Definition at line 178 of file diag-gmm.h.
References DiagGmm::weights_.
Referenced by RegressionTree::BuildTree(), kaldi::ClusterGaussiansToUbm(), BasisFmllrEstimate::ComputeAmDiagPrecond(), FullGmm::CopyFromDiagGmm(), DiagGmm::DiagGmm(), DecodableAmDiagGmmRegtreeMllr::GetXformedMeanInvVars(), main(), DiagGmm::Merge(), test_flags_driven_update(), kaldi::UnitTestDiagGmm(), UnitTestEstimateDiagGmm(), and kaldi::UnitTestEstimateMmieDiagGmm().
void Write | ( | std::ostream & | os, |
bool | binary | ||
) | const |
Definition at line 705 of file diag-gmm.cc.
References DiagGmm::gconsts_, DiagGmm::inv_vars_, KALDI_ERR, DiagGmm::means_invvars_, DiagGmm::valid_gconsts_, DiagGmm::weights_, MatrixBase< Real >::Write(), and kaldi::WriteToken().
Referenced by DiagGmm::Dim(), main(), kaldi::operator<<(), kaldi::UnitTestDiagGmm(), and Fmpe::Write().
|
friend |
this makes it a little easier to modify the internals
Definition at line 44 of file diag-gmm.h.
Equals log(weight) - 0.5 * (log det(var) + mean*mean*inv(var))
Definition at line 232 of file diag-gmm.h.
Referenced by DiagGmm::ComponentLogLikelihood(), DiagGmm::ComputeGconsts(), DiagGmm::CopyFromDiagGmm(), DiagGmm::CopyFromFullGmm(), DiagGmm::gconsts(), DiagGmm::LogLikelihoods(), DiagGmm::LogLikelihoodsPreselect(), DiagGmm::Merge(), DiagGmm::Read(), DiagGmm::RemoveComponent(), DiagGmm::Resize(), DiagGmm::Split(), and DiagGmm::Write().
Inverted (diagonal) variances.
Definition at line 235 of file diag-gmm.h.
Referenced by DiagGmm::ComponentLogLikelihood(), DiagGmm::ComputeGconsts(), DiagGmmNormal::CopyFromDiagGmm(), DiagGmm::CopyFromDiagGmm(), DiagGmm::CopyFromFullGmm(), DiagGmmNormal::CopyToDiagGmm(), DiagGmm::DiagGmm(), DiagGmm::Generate(), DiagGmm::GetComponentMean(), DiagGmm::GetComponentVariance(), DiagGmm::GetMeans(), DiagGmm::GetVars(), DiagGmm::inv_vars(), DiagGmm::LogLikelihoods(), DiagGmm::LogLikelihoodsPreselect(), DiagGmm::Merge(), DiagGmm::MergeKmeans(), DiagGmm::Perturb(), DiagGmm::Read(), DiagGmm::RemoveComponent(), DiagGmm::Resize(), DiagGmm::SetComponentInvVar(), DiagGmm::SetComponentMean(), DiagGmm::SetInvVars(), DiagGmm::SetInvVarsAndMeans(), DiagGmm::SetMeans(), DiagGmm::Split(), and DiagGmm::Write().
Means times inverted variance.
Definition at line 236 of file diag-gmm.h.
Referenced by DiagGmm::ComponentLogLikelihood(), DiagGmm::ComputeGconsts(), DiagGmmNormal::CopyFromDiagGmm(), DiagGmm::CopyFromDiagGmm(), DiagGmm::CopyFromFullGmm(), DiagGmmNormal::CopyToDiagGmm(), DiagGmm::DiagGmm(), DiagGmm::Dim(), DiagGmm::Generate(), DiagGmm::GetComponentMean(), DiagGmm::GetMeans(), DiagGmm::LogLikelihoods(), DiagGmm::LogLikelihoodsPreselect(), DiagGmm::means_invvars(), DiagGmm::Merge(), DiagGmm::MergeKmeans(), DiagGmm::Perturb(), DiagGmm::Read(), DiagGmm::RemoveComponent(), DiagGmm::Resize(), DiagGmm::SetComponentInvVar(), DiagGmm::SetComponentMean(), DiagGmm::SetInvVars(), DiagGmm::SetInvVarsAndMeans(), DiagGmm::SetMeans(), DiagGmm::Split(), and DiagGmm::Write().
|
private |
Recompute gconsts_ if false.
Definition at line 233 of file diag-gmm.h.
Referenced by DiagGmm::ComponentLogLikelihood(), DiagGmm::ComponentPosteriors(), DiagGmm::ComputeGconsts(), DiagGmm::CopyFromDiagGmm(), DiagGmmNormal::CopyToDiagGmm(), DiagGmm::gconsts(), DiagGmm::LogLikelihood(), DiagGmm::RemoveComponent(), DiagGmm::Resize(), DiagGmm::SetComponentInvVar(), DiagGmm::SetComponentMean(), DiagGmm::SetComponentWeight(), DiagGmm::SetInvVars(), DiagGmm::SetInvVarsAndMeans(), DiagGmm::SetMeans(), DiagGmm::SetWeights(), DiagGmm::valid_gconsts(), and DiagGmm::Write().
weights (not log).
Definition at line 234 of file diag-gmm.h.
Referenced by DiagGmm::ComputeGconsts(), DiagGmmNormal::CopyFromDiagGmm(), DiagGmm::CopyFromDiagGmm(), DiagGmm::CopyFromFullGmm(), DiagGmmNormal::CopyToDiagGmm(), DiagGmm::DiagGmm(), DiagGmm::Generate(), DiagGmm::Merge(), DiagGmm::MergeKmeans(), DiagGmm::NumGauss(), DiagGmm::Read(), DiagGmm::RemoveComponent(), DiagGmm::Resize(), DiagGmm::SetComponentWeight(), DiagGmm::SetWeights(), DiagGmm::Split(), DiagGmm::weights(), and DiagGmm::Write().