26 int main(
int argc,
char *argv[]) {
28 using namespace kaldi;
33 "Initialize nnet3 am-nnet (i.e. neural network-based acoustic model, with\n" 34 "associated transition model) from an existing transition model and nnet..\n" 35 "Search for examples in scripts in /egs/wsj/s5/steps/nnet3/\n" 36 "Set priors using nnet3-am-train-transitions or nnet3-am-adjust-priors\n" 38 "Usage: nnet3-am-init [options] <tree-in> <topology-in> <input-raw-nnet> <output-am-nnet>\n" 39 " or: nnet3-am-init [options] <trans-model-in> <input-raw-nnet> <output-am-nnet>\n" 41 " nnet3-am-init tree topo 0.raw 0.mdl\n" 42 "See also: nnet3-init, nnet3-am-copy, nnet3-am-info, nnet3-am-train-transitions,\n" 43 " nnet3-am-adjust-priors\n";
45 bool binary_write =
true;
48 po.
Register(
"binary", &binary_write,
"Write output in binary mode");
57 std::string raw_nnet_rxfilename,
62 std::string tree_rxfilename = po.
GetArg(1),
63 topo_rxfilename = po.
GetArg(2);
64 raw_nnet_rxfilename = po.
GetArg(3);
65 am_nnet_wxfilename = po.
GetArg(4);
76 std::string trans_model_rxfilename = po.
GetArg(1);
77 raw_nnet_rxfilename = po.
GetArg(2);
78 am_nnet_wxfilename = po.
GetArg(3);
91 Output ko(am_nnet_wxfilename, binary_write);
96 KALDI_LOG <<
"Initialized am-nnet (neural net acoustic model) and wrote to " 97 << am_nnet_wxfilename;
99 }
catch(
const std::exception &e) {
100 std::cerr << e.what() <<
'\n';
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
A class for storing topology information for phones.
void PrintUsage(bool print_command_line=false)
Prints the usage documentation [provided in the constructor].
void Register(const std::string &name, bool *ptr, const std::string &doc)
void ReadKaldiObject(const std::string &filename, Matrix< float > *m)
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
int Read(int argc, const char *const *argv)
Parses the command line options and fills the ParseOptions-registered variables.
std::string GetArg(int param) const
Returns one of the positional parameters; 1-based indexing for argc/argv compatibility.
int NumArgs() const
Number of positional parameters (c.f. argc-1).
void Write(std::ostream &os, bool binary) const
int main(int argc, char *argv[])
void Write(std::ostream &os, bool binary) const