24 #ifndef KALDI_GMM_MLE_DIAG_GMM_H_ 25 #define KALDI_GMM_MLE_DIAG_GMM_H_ 1 54 min_gaussian_weight = 1.0e-05;
55 min_gaussian_occupancy = 10.0;
57 remove_low_count_gaussians =
true;
60 std::string module =
"MleDiagGmmOptions: ";
61 opts->
Register(
"min-gaussian-weight", &min_gaussian_weight,
62 module+
"Min Gaussian weight before we remove it.");
63 opts->
Register(
"min-gaussian-occupancy", &min_gaussian_occupancy,
64 module+
"Minimum occupancy to update a Gaussian.");
65 opts->
Register(
"min-variance", &min_variance,
66 module+
"Variance floor (absolute variance).");
67 opts->
Register(
"remove-low-count-gaussians", &remove_low_count_gaussians,
68 module+
"If true, remove Gaussians that fall below the floors.");
94 opts->
Register(
"mean-tau", &mean_tau,
95 "Tau value for updating means.");
96 opts->
Register(
"variance-tau", &mean_tau,
97 "Tau value for updating variances (note: only relevant if " 98 "update-flags contains \"v\".");
99 opts->
Register(
"weight-tau", &weight_tau,
100 "Tau value for updating weights.");
115 void Read(std::istream &in_stream,
bool binary,
bool add);
116 void Write(std::ostream &out_stream,
bool binary)
const;
148 BaseFloat AccumulateFromDiagMultiThreaded(
158 void AddStatsForComponent(
int32 comp_id,
220 int32 *floored_elements_out = NULL,
221 int32 *floored_gauss_out = NULL,
222 int32 *removed_gauss_out = NULL);
239 #endif // KALDI_GMM_MLE_DIAG_GMM_H_ This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
int32 Dim() const
Returns the dimensionality of the Gaussian mean vectors.
void MapDiagGmmUpdate(const MapDiagGmmOptions &config, const AccumDiagGmm &diag_gmm_acc, GmmFlagsType flags, DiagGmm *gmm, BaseFloat *obj_change_out, BaseFloat *count_out)
Maximum A Posteriori estimation of the model.
bool remove_low_count_gaussians
GmmFlagsType AugmentGmmFlags(GmmFlagsType f)
Returns "augmented" version of flags: e.g.
BaseFloat weight_tau
Tau value for the weights– this tau value is applied per state, not per Gaussian.
Base class which provides matrix operations not involving resizing or allocation. ...
BaseFloat min_gaussian_occupancy
Minimum count below which a Gaussian is not updated (and is removed, if remove_low_count_gaussians ==...
void MleDiagGmmUpdate(const MleDiagGmmOptions &config, const AccumDiagGmm &diag_gmm_acc, GmmFlagsType flags, DiagGmm *gmm, BaseFloat *obj_change_out, BaseFloat *count_out, int32 *floored_elements_out, int32 *floored_gaussians_out, int32 *removed_gaussians_out)
for computing the maximum-likelihood estimates of the parameters of a Gaussian mixture model...
BaseFloat MlObjective(const DiagGmm &gmm, const AccumDiagGmm &diag_gmm_acc)
Calc using the DiagGMM exponential form.
Matrix< double > mean_accumulator_
const VectorBase< double > & occupancy() const
uint16 GmmFlagsType
Bitwise OR of the above flags.
void Register(OptionsItf *opts)
double min_variance
Minimum allowed variance in any dimension (if no variance floor) It is in double since the variance i...
AccumDiagGmm(const DiagGmm &gmm, GmmFlagsType flags)
virtual void Register(const std::string &name, bool *ptr, const std::string &doc)=0
GmmFlagsType flags_
Flags corresponding to the accumulators that are stored.
const MatrixBase< double > & variance_accumulator() const
const MatrixBase< double > & mean_accumulator() const
GmmFlagsType Flags() const
void Register(OptionsItf *opts)
int32 NumGauss() const
Returns the number of mixture components in the GMM.
Configuration variables like variance floor, minimum occupancy, etc.
Vector< double > occupancy_
int32 Dim() const
Returns the dimensionality of the feature vectors.
Vector< double > variance_floor_vector
Variance floor for each dimension [empty if not supplied].
BaseFloat min_gaussian_weight
Minimum weight below which a Gaussian is not updated (and is removed, if remove_low_count_gaussians =...
Matrix< double > variance_accumulator_
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.
Provides a vector abstraction class.
void Resize(int32 num_gauss, int32 dim, GmmFlagsType flags)
Allocates memory for accumulators.
BaseFloat variance_tau
Tau value for the variances.
BaseFloat mean_tau
Tau value for the means.
int32 NumGauss() const
Returns the number of mixture components.
Configuration variables for Maximum A Posteriori (MAP) update.