26 int main(
int argc,
char *argv[]) {
28 using namespace kaldi;
32 "Do update for MLLT (also known as STC)\n" 33 "Usage: est-mllt [options] <mllt-mat-out> <stats-in1> <stats-in2> ... \n" 34 "e.g.: est-mllt 2.mat 1a.macc 1b.macc ... \n" 35 "where the stats are obtained from gmm-acc-mllt\n" 36 "Note: use compose-transforms <mllt-mat-out> <prev-mllt-mat> to combine with previous\n" 37 " MLLT or LDA transform, if any, and\n" 38 " gmm-transform-means to apply <mllt-mat-out> to GMM means.\n";
43 po.
Register(
"binary", &binary,
"Write output in binary mode");
52 std::string mllt_out_filename = po.
GetArg(1);
56 std::string acc_filename = po.
GetArg(
i);
57 bool binary_in, add =
true;
58 Input ki(acc_filename, &binary_in);
65 mllt_accs.
Update(&mat, &objf_impr, &count);
67 KALDI_LOG <<
"Overall objective function improvement for MLLT is " 68 << (objf_impr/
count) <<
" over " << count <<
" frames, logdet is " 71 Output ko(mllt_out_filename, binary);
72 mat.Write(ko.
Stream(), binary);
75 }
catch(
const std::exception &e) {
76 std::cerr << e.what() <<
'\n';
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
void PrintUsage(bool print_command_line=false)
Prints the usage documentation [provided in the constructor].
void Read(std::istream &is, bool binary, bool add=false)
void SetUnit()
Sets to zero, except ones along diagonal [for non-square matrices too].
void Register(const std::string &name, bool *ptr, const std::string &doc)
void Update(MatrixBase< BaseFloat > *M, BaseFloat *objf_impr_out, BaseFloat *count_out) const
The Update function does the ML update; it requires that M has the right size.
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 main(int argc, char *argv[])
int NumArgs() const
Number of positional parameters (c.f. argc-1).
A class for estimating Maximum Likelihood Linear Transform, also known as global Semi-tied Covariance...