Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 24 of file nnet-initialize.cc.
References ParseOptions::GetArg(), Nnet::Init(), KALDI_LOG, ParseOptions::NumArgs(), ParseOptions::PrintUsage(), ParseOptions::Read(), ParseOptions::Register(), kaldi::SetVerboseLevel(), Output::Stream(), and Nnet::Write().
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");
45 if (po.NumArgs() != 2) {
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);
61 nnet.
Write(ko.Stream(), 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 Write(const std::string &wxfilename, bool binary) const
Write Nnet to 'wxfilename',.
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...
void Init(const std::string &proto_file)
Initialize the Nnet from the prototype,.