26 int main(
int argc,
char *argv[]) {
31 "Compute \"pre-transform\" parameters required for estimating fMLLR with\n" 32 "SGMMs, and write to a model file, after the SGMM.\n" 33 "Usage: sgmm2-comp-prexform [options] <sgmm2-in> <occs-in> <sgmm-out>\n";
37 po.
Register(
"binary", &binary,
"Write output in binary mode");
45 std::string sgmm_in_filename = po.
GetArg(1),
46 occs_filename = po.
GetArg(2),
47 sgmm_out_filename = po.
GetArg(3);
77 KALDI_LOG <<
"Written model to " << sgmm_out_filename;
78 }
catch(
const std::exception &e) {
79 std::cerr << e.what() <<
'\n';
void Write(std::ostream &os, bool binary, SgmmWriteFlagsType write_params) const
Class for definition of the subspace Gmm acoustic model.
void Write(std::ostream &out_stream, bool binary) const
Matrix< BaseFloat > pre_xform_
Pre-transform matrix. Dim is [D][D+1].
void PrintUsage(bool print_command_line=false)
Prints the usage documentation [provided in the constructor].
void Read(std::istream &is, bool binary)
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...
Matrix< BaseFloat > inv_xform_
Inverse of pre-transform. Dim is [D][D+1].
void Read(std::istream &is, bool binary)
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).
void Write(std::ostream &os, bool binary) const
A class representing a vector.
Global adaptation parameters.
Vector< BaseFloat > mean_scatter_
Diagonal of mean-scatter matrix. Dim is [D].
void Read(std::istream &in, bool binary, bool add=false)
Read function using C++ streams.
void ComputeFmllrPreXform(const Vector< BaseFloat > &pdf_occs, Matrix< BaseFloat > *xform, Matrix< BaseFloat > *inv_xform, Vector< BaseFloat > *diag_mean_scatter) const
Computes the LDA-like pre-transform and its inverse as well as the eigenvalues of the scatter of the ...