26 int main(
int argc,
char *argv[]) {
28 using namespace kaldi;
33 "Initialize nnet3 neural network from a config file; outputs 'raw' nnet\n" 34 "without associated information such as transition model and priors.\n" 35 "Search for examples in scripts in /egs/wsj/s5/steps/nnet3/\n" 36 "Can also be used to add layers to existing model (provide existing model\n" 39 "Usage: nnet3-init [options] [<existing-model-in>] <config-in> <raw-nnet-out>\n" 41 " nnet3-init nnet.config 0.raw\n" 42 "or: nnet3-init 1.raw nnet.config 2.raw\n" 43 "See also: nnet3-copy, nnet3-info\n";
45 bool binary_write =
true;
49 po.
Register(
"binary", &binary_write,
"Write output in binary mode");
50 po.
Register(
"srand", &srand_seed,
"Seed for random number generator");
60 std::string raw_nnet_rxfilename = (po.
NumArgs() == 3 ?
61 po.
GetArg(1) : std::string(
"")),
69 << raw_nnet_rxfilename;
74 Input ki(config_rxfilename, &binary);
75 KALDI_ASSERT(!binary &&
"Expect config file to contain text.");
80 KALDI_LOG <<
"Initialized raw neural net and wrote it to " 81 << raw_nnet_wxfilename;
83 }
catch(
const std::exception &e) {
84 std::cerr << e.what() <<
'\n';
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void ReadConfig(std::istream &config_file)
int main(int argc, char *argv[])
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).
#define KALDI_ASSERT(cond)
void WriteKaldiObject(const C &c, const std::string &filename, bool binary)