26 using namespace kaldi;
30 "Get feature-projection transform using stats obtained with acc-lda.\n" 31 "See comments in the code of nnet2/get-feature-transform.h for more\n" 34 "Usage: nnet-get-feature-transform [options] <matrix-out> <lda-acc-1> <lda-acc-2> ...\n";
38 std::string write_cholesky;
39 std::string write_within_covar;
41 po.Register(
"binary", &binary,
"Write outputs in binary mode.");
42 po.Register(
"write-cholesky", &write_cholesky,
"If supplied, write to this " 43 "wxfilename the Cholesky factor of the within-class covariance. " 44 "Can be used for perturbing features. E.g. " 45 "--write-cholesky=exp/nnet5/cholesky.tpmat");
46 po.Register(
"write-within-covar", &write_within_covar,
"If supplied, write " 47 "to this wxfilename the within-class covariance (as a symmetric " 48 "matrix). E.g. --write-within-covar=exp/nnet5/within_covar.mat");
52 if (po.NumArgs() < 2) {
58 std::string projection_wxfilename = po.GetArg(1);
60 for (int32
i = 2;
i <= po.NumArgs();
i++) {
61 bool binary_in, add =
true;
62 Input ki(po.GetArg(
i), &binary_in);
63 fte.
Read(ki.Stream(), binary_in, add);
69 (write_cholesky !=
"" || write_within_covar !=
"" ?
72 if (write_cholesky !=
"") {
75 if (write_within_covar !=
"") {
81 }
catch(
const std::exception &e) {
82 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Packed symetric matrix class.
MatrixIndexT NumRows() const
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
void Read(std::istream &in_stream, bool binary, bool add)
void AddTp2(const Real alpha, const TpMatrix< Real > &T, MatrixTransposeType transM, const Real beta=0.0)
The following function does: this <– beta*this + alpha * T * T^T.
Packed symetric matrix class.
void WriteKaldiObject(const C &c, const std::string &filename, bool binary)