67 using namespace kaldi;
71 "Combine a number of GMMs into a larger GMM, with #Gauss = \n" 72 " sum(individual #Gauss)). Output full GMM, and a text file with\n" 73 " sizes of each individual GMM.\n" 74 "Usage: fgmm-global-merge [options] fgmm-out sizes-file-out fgmm-in1 fgmm-in2 ...\n";
78 po.Register(
"binary", &binary,
"Write output in binary mode");
81 if (po.NumArgs() < 4) {
86 std::string fgmm_out_filename = po.GetArg(1),
87 sizes_out_filename = po.GetArg(2);
90 Output sizes_ko(sizes_out_filename,
false);
92 for (
int i = 3, max = po.NumArgs();
i <= max;
i++) {
93 std::string stats_in_filename = po.GetArg(
i);
95 Input ki(stats_in_filename, &binary_read);
97 fgmm.
Read(ki.Stream(), binary_read);
98 sizes_ko.Stream() << fgmm.
NumGauss() <<
' ';
101 fgmm2.
Read(ki.Stream(), binary_read);
102 sizes_ko.Stream() << fgmm2.
NumGauss() <<
' ';
106 sizes_ko.Stream() <<
"\n";
110 KALDI_LOG <<
"Written merged GMM to " << fgmm_out_filename;
111 }
catch(
const std::exception &e) {
112 std::cerr << e.what() <<
'\n';
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition for Gaussian Mixture Model with full covariances.
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
void MergeFullGmm(const FullGmm &src, FullGmm *dst)
merges GMMs by appending Gaussians in "src" to "dst".
int32 NumGauss() const
Returns the number of mixture components in the GMM.
void Read(std::istream &is, bool binary)
void WriteKaldiObject(const C &c, const std::string &filename, bool binary)