77 for (
int32 i = 0;
i < occs.Dim();
i++)
81 am_gmm1->
SplitByCount(occs, target_comp, 0.01, 0.2, 0.0);
99 for (
int32 i = 0;
i < occs.Dim();
i++)
112 for (
int32 i = 0;
i < num_pdfs;
i++) {
125 for (
int i = 0;
i < 5;
i++)
127 std::cout <<
"Test OK.\n";
void CopyFromAmDiagGmm(const AmDiagGmm &other)
Copies the parameters from another model. Allocates necessary memory.
void AddPdf(const DiagGmm &gmm)
Adds a GMM to the model, and increments the total number of PDFs.
float RandUniform(struct RandomState *state=NULL)
Returns a random number strictly between 0 and 1.
void TestAmDiagGmmIO(const AmDiagGmm &am_gmm)
float RandGauss(struct RandomState *state=NULL)
void TestSplitStates(const AmDiagGmm &am_gmm)
void ClusterGaussiansToUbm(const AmDiagGmm &am, const Vector< BaseFloat > &state_occs, UbmClusteringOptions opts, DiagGmm *ubm_out)
Clusters the Gaussians in an acoustic model to a single GMM with specified number of components...
BaseFloat LogLikelihood(const int32 pdf_index, const VectorBase< BaseFloat > &data) const
void InitRandDiagGmm(int32 dim, int32 num_comp, DiagGmm *gmm)
A class representing a vector.
void TestClustering(const AmDiagGmm &am_gmm)
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 Read(std::istream &in_stream, bool binary)
int32 RandInt(int32 min_val, int32 max_val, struct RandomState *state)
void SplitByCount(const Vector< BaseFloat > &state_occs, int32 target_components, float perturb_factor, BaseFloat power, BaseFloat min_count)