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");
47 if (po.NumArgs() < 3) {
53 model_rxfilename = po.GetArg(1),
54 basis_wspecifier = po.GetArg(2);
60 Input ki(model_rxfilename, &binary);
61 trans_model.
Read(ki.Stream(), binary);
62 am_gmm.
Read(ki.Stream(), 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...
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)
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.