All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
fgmm-global-info.cc File Reference
Include dependency graph for fgmm-global-info.cc:

Go to the source code of this file.

Functions

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

Function Documentation

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

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

References FullGmm::Dim(), ParseOptions::GetArg(), ParseOptions::NumArgs(), FullGmm::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 full-covariance GMM model\n"
32  "This is for a single mixture of Gaussians, e.g. as used for a UBM.\n"
33  "Usage: fgmm-global-info [options] <gmm>\n"
34  "e.g.:\n"
35  " fgmm-global-info 1.ubm\n";
36 
37  ParseOptions po(usage);
38 
39  po.Read(argc, argv);
40 
41  if (po.NumArgs() != 1) {
42  po.PrintUsage();
43  exit(1);
44  }
45 
46  std::string model_rxfilename = po.GetArg(1);
47 
48  FullGmm gmm;
49  ReadKaldiObject(model_rxfilename, &gmm);
50 
51  std::cout << "number of gaussians " << gmm.NumGauss() << '\n';
52  std::cout << "feature dimension " << gmm.Dim() << '\n';
53  return 0;
54  } catch(const std::exception &e) {
55  std::cerr << e.what() << '\n';
56  return -1;
57  }
58 }
Relabels neural network egs with the read pdf-id alignments.
Definition: chain.dox:20
int32 Dim() const
Returns the dimensionality of the Gaussian mean vectors.
Definition: full-gmm.h:60
int32 NumGauss() const
Returns the number of mixture components in the GMM.
Definition: full-gmm.h:58
Definition for Gaussian Mixture Model with full covariances.
Definition: full-gmm.h:40
void ReadKaldiObject(const std::string &filename, Matrix< float > *m)
Definition: kaldi-io.cc:818
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
Definition: parse-options.h:36