24 int main(
int argc,
char *argv[]) {
26 using namespace kaldi;
31 "Concatenate Neural Networks (and possibly change binary/text format)\n" 32 "Usage: nnet-concat [options] <nnet-in1> <...> <nnet-inN> <nnet-out>\n" 34 " nnet-concat --binary=false nnet.1 nnet.2 nnet.1.2\n";
38 bool binary_write =
true;
39 po.
Register(
"binary", &binary_write,
"Write output in binary mode");
48 std::string model_in_filename = po.
GetArg(1);
49 std::string model_in_filename_next;
53 KALDI_LOG <<
"Reading " << model_in_filename;
57 Input ki(model_in_filename, &binary_read);
64 model_in_filename_next = po.
GetArg(
i);
65 KALDI_LOG <<
"Concatenating " << model_in_filename_next;
69 Input ki(model_in_filename_next, &binary_read);
78 Output ko(model_out_filename, binary_write);
82 KALDI_LOG <<
"Written model to " << model_out_filename;
84 }
catch(
const std::exception &e) {
85 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',.
int main(int argc, char *argv[])
void Register(const std::string &name, bool *ptr, const std::string &doc)
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
void AppendNnet(const Nnet &nnet_to_append)
Append other Nnet to the 'this' Nnet (copy all its components),.
int Read(int argc, const char *const *argv)
Parses the command line options and fills the ParseOptions-registered variables.
void Read(const std::string &rxfilename)
Read Nnet from 'rxfilename',.
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).