gmm-global-info.cc File Reference
Include dependency graph for gmm-global-info.cc:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 25 of file gmm-global-info.cc.

References DiagGmm::Dim(), ParseOptions::GetArg(), ParseOptions::NumArgs(), DiagGmm::NumGauss(), ParseOptions::PrintUsage(), ParseOptions::Read(), and kaldi::ReadKaldiObject().

25  {
26  try {
27  using namespace kaldi;
28  typedef kaldi::int32 int32;
29 
30  const char *usage =
31  "Write to standard output various properties of GMM model\n"
32  "This is for a single diagonal GMM, e.g. as used for a UBM.\n"
33  "Usage: gmm-global-info [options] <gmm>\n"
34  "e.g.:\n"
35  " gmm-global-info 1.dubm\n"
36  "See also: gmm-info, am-info\n";
37 
38  ParseOptions po(usage);
39 
40  po.Read(argc, argv);
41 
42  if (po.NumArgs() != 1) {
43  po.PrintUsage();
44  exit(1);
45  }
46 
47  std::string model_rxfilename = po.GetArg(1);
48 
49  DiagGmm gmm;
50  ReadKaldiObject(model_rxfilename, &gmm);
51 
52  std::cout << "number of gaussians " << gmm.NumGauss() << '\n';
53  std::cout << "feature dimension " << gmm.Dim() << '\n';
54  return 0;
55  } catch(const std::exception &e) {
56  std::cerr << e.what() << '\n';
57  return -1;
58  }
59 }
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
int32 Dim() const
Returns the dimensionality of the Gaussian mean vectors.
Definition: diag-gmm.h:74
kaldi::int32 int32
void ReadKaldiObject(const std::string &filename, Matrix< float > *m)
Definition: kaldi-io.cc:832
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
Definition: parse-options.h:36
int32 NumGauss() const
Returns the number of mixture components in the GMM.
Definition: diag-gmm.h:72
Definition for Gaussian Mixture Model with diagonal covariances.
Definition: diag-gmm.h:42