24 int main(
int argc,
char *argv[]) {
26 using namespace kaldi;
31 "Initialize Neural Network parameters according to a prototype (nnet1).\n" 32 "Usage: nnet-initialize [options] <nnet-prototype-in> <nnet-out>\n" 33 "e.g.: nnet-initialize --binary=false nnet.proto nnet.init\n";
38 bool binary_write =
true;
39 po.
Register(
"binary", &binary_write,
"Write output in binary mode");
41 po.
Register(
"seed", &seed,
"Seed for random number generator");
50 std::string nnet_config_in_filename = po.
GetArg(1),
51 nnet_out_filename = po.
GetArg(2);
57 nnet.
Init(nnet_config_in_filename);
60 Output ko(nnet_out_filename, binary_write);
63 KALDI_LOG <<
"Written initialized model to " << nnet_out_filename;
65 }
catch(
const std::exception &e) {
66 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void PrintUsage(bool print_command_line=false)
Prints the usage documentation [provided in the constructor].
void Write(const std::string &wxfilename, bool binary) const
Write Nnet to 'wxfilename',.
void Register(const std::string &name, bool *ptr, const std::string &doc)
int main(int argc, char *argv[])
void SetVerboseLevel(int32 i)
This should be rarely used, except by programs using Kaldi as library; command-line programs set the ...
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 Init(const std::string &proto_file)
Initialize the Nnet from the prototype,.