25 int main(
int argc,
char *argv[]) {
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");
58 std::string projection_wxfilename = po.
GetArg(1);
61 bool binary_in, add =
true;
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.
void PrintUsage(bool print_command_line=false)
Prints the usage documentation [provided in the constructor].
MatrixIndexT NumRows() const
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 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.
int Read(int argc, const char *const *argv)
Parses the command line options and fills the ParseOptions-registered variables.
Packed symetric matrix class.
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).
void WriteKaldiObject(const C &c, const std::string &filename, bool binary)