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");
44 if (po.NumArgs() != 2) {
49 std::string transform_rxfilename = po.GetArg(1),
50 model_out_filename = po.GetArg(2);
56 Input ki(transform_rxfilename, &binary_read);
57 transform.
Read(ki.Stream(), binary_read);
68 Output ko(model_out_filename, binary_write);
69 nnet.
Write(ko.Stream(), 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).
void Write(const std::string &wxfilename, bool binary) const
Write Nnet to 'wxfilename',.
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...
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),.