All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
tree-info.cc File Reference
Include dependency graph for tree-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 26 of file tree-info.cc.

References ContextDependency::CentralPosition(), ContextDependency::ContextWidth(), ParseOptions::GetArg(), ParseOptions::NumArgs(), ContextDependency::NumPdfs(), ParseOptions::PrintUsage(), ParseOptions::Read(), and kaldi::ReadKaldiObject().

26  {
27  using namespace kaldi;
28  try {
29  using namespace kaldi;
30  typedef kaldi::int32 int32;
31 
32  const char *usage =
33  "Print information about decision tree (mainly the number of pdfs), to stdout\n"
34  "Usage: tree-info <tree-in>\n";
35 
36  ParseOptions po(usage);
37 
38  po.Read(argc, argv);
39 
40  if (po.NumArgs() != 1) {
41  po.PrintUsage();
42  exit(1);
43  }
44 
45  std::string tree_in_filename = po.GetArg(1);
46 
47  ContextDependency ctx_dep;
48  ReadKaldiObject(tree_in_filename, &ctx_dep);
49 
50  std::cout << "num-pdfs " << ctx_dep.NumPdfs() << std::endl;
51  std::cout << "context-width " << ctx_dep.ContextWidth() << std::endl;
52  std::cout << "central-position " << ctx_dep.CentralPosition() << std::endl;
53 
54  } catch(const std::exception &e) {
55  std::cerr << e.what();
56  return -1;
57  }
58 }
Relabels neural network egs with the read pdf-id alignments.
Definition: chain.dox:20
virtual int32 ContextWidth() const
ContextWidth() returns the value N (e.g.
Definition: context-dep.h:61
virtual int32 NumPdfs() const
NumPdfs() returns the number of acoustic pdfs (they are numbered 0.. NumPdfs()-1).
Definition: context-dep.h:71
void ReadKaldiObject(const std::string &filename, Matrix< float > *m)
Definition: kaldi-io.cc:818
virtual int32 CentralPosition() const
Central position P of the phone context, in 0-based numbering, e.g.
Definition: context-dep.h:62
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
Definition: parse-options.h:36