30 using namespace kaldi;
33 "Print various information about an SGMM.\n" 34 "Usage: sgmm2-info [options] <model-in> [model-in2 ... ]\n";
36 bool sgmm_detailed =
false;
37 bool trans_detailed =
false;
40 po.Register(
"sgmm2-detailed", &sgmm_detailed,
41 "Print detailed information about substates.");
42 po.Register(
"trans-detailed", &trans_detailed,
43 "Print detailed information about transition model.");
46 if (po.NumArgs() < 1) {
51 for (
int i = 1, max = po.NumArgs();
i <= max; ++
i) {
52 std::string model_in_filename = po.GetArg(
i);
57 Input ki(model_in_filename, &binary);
58 trans_model.
Read(ki.Stream(), binary);
59 am_sgmm.
Read(ki.Stream(), binary);
65 cout <<
"\nModel file: " << model_in_filename << endl;
66 cout <<
" SGMM information:\n" 67 << setw(40) <<
" # of HMM states" << am_sgmm.
NumPdfs() << endl
68 << setw(40) <<
" # of Gaussians per state" << am_sgmm.
NumGauss() << endl
69 << setw(40) <<
" Dimension of phone vector space" 71 << setw(40) <<
" Dimension of speaker vector space" 73 << setw(40) <<
" Dimension of feature vectors" 75 int32 total_mixweights = 0;
76 for (int32 j2 = 0; j2 < am_sgmm.
NumPdfs(); j2++) {
79 cout <<
" # of substates for state " << setw(13) << j2
83 cout << setw(40) <<
" Total # of mixture weights " << total_mixweights << endl;
85 cout << setw(40) <<
" Total # of groups of pdfs " << total_groups << endl;
86 int32 total_substates = 0;
87 for (int32 j1 = 0; j1 < am_sgmm.
NumGroups(); j1++) {
90 cout << setw(40) <<
" Total # of substates " << total_substates << endl;
91 cout <<
"\nTransition model information:\n" 92 << setw(40) <<
" # of HMM states" << trans_model.
NumPdfs() << endl
93 << setw(40) <<
" # of transition states" 95 int32 total_indices = 0;
99 cout <<
" # of transition ids for state " << setw(8) << s
103 cout << setw(40) <<
" Total # of transition ids " << total_indices
109 }
catch(
const std::exception &e) {
110 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Class for definition of the subspace Gmm acoustic model.
void Read(std::istream &is, bool binary)
int32 PhoneSpaceDim() const
int32 NumSubstatesForPdf(int32 j2) const
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
void Read(std::istream &is, bool binary)
int32 NumTransitionIndices(int32 trans_state) const
Returns the number of transition-indices for a particular transition-state.
int32 NumPdfs() const
Various model dimensions.
int32 SpkSpaceDim() const
int32 NumSubstatesForGroup(int32 j1) const
int32 NumTransitionStates() const
Returns the total number of transition-states (note, these are one-based).