32 int main(
int argc,
char *argv[]) {
35 using namespace kaldi;
37 "Estimate fMLLR basis representation. Reads a set of gradient scatter\n" 38 "accumulations. Outputs basis matrices.\n" 39 "Usage: gmm-basis-fmllr-training [options] <model-in> <basis-wspecifier> " 40 "<accs-in1> <accs-in2> ...\n";
42 bool binary_write =
true;
44 po.
Register(
"binary", &binary_write,
"Write output in binary mode");
53 model_rxfilename = po.
GetArg(1),
54 basis_wspecifier = po.
GetArg(2);
60 Input ki(model_rxfilename, &binary);
66 int num_accs = po.
NumArgs() - 2;
68 for (
int i = 3, max = po.
NumArgs();
i <= max; ++
i) {
69 std::string accs_in_filename = po.
GetArg(
i);
72 basis_accs.Read(ki.
Stream(), binary_read,
true );
80 KALDI_LOG <<
"Summed " << num_accs <<
" gradient scatter stats";
81 KALDI_LOG <<
"Generate " << basis_est.BasisSize() <<
" bases, written to " 84 }
catch(
const std::exception& e) {
85 std::cerr << e.what();
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].
int main(int argc, char *argv[])
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...
Stats for fMLLR subspace estimation.
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 WriteKaldiObject(const C &c, const std::string &filename, bool binary)
void EstimateFmllrBasis(const AmDiagGmm &am_gmm, const BasisFmllrAccus &basis_accus)
Estimate the base matrices efficiently in a Maximum Likelihood manner.
void Read(std::istream &in_stream, bool binary)
Estimation functions for basis fMLLR.