nnet3-am-info.cc File Reference
Include dependency graph for nnet3-am-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 nnet3-am-info.cc.

References ParseOptions::GetArg(), AmNnetSimple::Info(), ParseOptions::NumArgs(), ParseOptions::PrintUsage(), AmNnetSimple::Read(), ParseOptions::Read(), TransitionModel::Read(), and Input::Stream().

25  {
26  try {
27  using namespace kaldi;
28  using namespace kaldi::nnet3;
29  typedef kaldi::int32 int32;
30 
31  const char *usage =
32  "Print some text information about an nnet3 neural network, to\n"
33  "standard output\n"
34  "\n"
35  "Usage: nnet3-am-info [options] <nnet>\n"
36  "e.g.:\n"
37  " nnet3-am-info 0.mdl\n"
38  "See also: nnet3-am-info\n";
39 
40  ParseOptions po(usage);
41 
42  po.Read(argc, argv);
43 
44  if (po.NumArgs() != 1) {
45  po.PrintUsage();
46  exit(1);
47  }
48 
49  std::string nnet_rxfilename = po.GetArg(1);
50 
51  TransitionModel trans_model;
52  AmNnetSimple am_nnet;
53  {
54  bool binary;
55  Input ki(nnet_rxfilename, &binary);
56  trans_model.Read(ki.Stream(), binary);
57  am_nnet.Read(ki.Stream(), binary);
58  }
59  std::cout << am_nnet.Info();
60 
61  return 0;
62  } catch(const std::exception &e) {
63  std::cerr << e.what() << '\n';
64  return -1;
65  }
66 }
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
std::string Info() const
kaldi::int32 int32
void Read(std::istream &is, bool binary)
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
Definition: parse-options.h:36
void Read(std::istream &is, bool binary)