25 int main(
int argc,
char *argv[]) {
27 using namespace kaldi;
32 "Convert transformation matrix to <affine-transform>\n" 33 "Usage: transf-to-nnet [options] <transf-in> <nnet-out>\n" 35 " transf-to-nnet --binary=false transf.mat nnet.mdl\n";
37 bool binary_write =
false;
40 po.
Register(
"binary", &binary_write,
"Write output in binary mode");
49 std::string transform_rxfilename = po.
GetArg(1),
50 model_out_filename = po.
GetArg(2);
56 Input ki(transform_rxfilename, &binary_read);
68 Output ko(model_out_filename, binary_write);
70 KALDI_LOG <<
"Written transform in 'nnet1' model: " << model_out_filename;
73 }
catch(
const std::exception &e) {
74 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
MatrixIndexT NumCols() const
Returns number of columns (or zero for empty matrix).
int main(int argc, char *argv[])
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)
void Read(std::istream &in, bool binary, bool add=false)
read from stream.
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).
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).
void AppendComponent(const Component &comp)
Append Component to 'this' instance of Nnet (deep copy),.