22 #ifndef KALDI_TRANSFORM_REGRESSION_TREE_H_ 23 #define KALDI_TRANSFORM_REGRESSION_TREE_H_ 49 const std::vector<int32> &sil_indices,
59 bool GatherStats(
const std::vector<AffineXformStats*> &stats_in,
61 std::vector<int32> *regclasses_out,
62 std::vector<AffineXformStats*> *stats_out)
const;
64 void Write(std::ostream &out,
bool binary)
const;
65 void Read(std::istream &in,
bool binary,
const AmDiagGmm &am);
84 std::vector< std::vector< std::pair<int32, int32> > >
baseclasses_;
99 #endif // KALDI_TRANSFORM_REGRESSION_TREE_H_
void Read(std::istream &in, bool binary, const AmDiagGmm &am)
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
int32 Gauss2BaseclassId(size_t pdf_id, size_t gauss_id) const
std::vector< std::vector< int32 > > gauss2bclass_
Mapping from (pdf, gaussian) indices to baseclasses.
const std::vector< std::pair< int32, int32 > > & GetBaseclass(int32 bclass) const
int32 num_baseclasses_
Number of leaf nodes.
std::vector< std::vector< std::pair< int32, int32 > > > baseclasses_
Each baseclass (leaf of regression tree) is a vector of Gaussian indices.
std::vector< int32 > parents_
For each node, index of its parent: size = num_nodes_ If 0 <= i < num_baseclasses_, then i is a leaf of the tree (a base class); else a non-leaf node.
void MakeGauss2Bclass(const AmDiagGmm &am)
void Write(std::ostream &out, bool binary) const
bool GatherStats(const std::vector< AffineXformStats *> &stats_in, double min_count, std::vector< int32 > *regclasses_out, std::vector< AffineXformStats *> *stats_out) const
Parses the regression tree and finds the nodes whose occupancies (read from stats_in) are greater tha...
int32 NumBaseclasses() const
Accessors (const)
void BuildTree(const Vector< BaseFloat > &state_occs, const std::vector< int32 > &sil_indices, const AmDiagGmm &am, int32 max_clusters)
Top-down clustering of the Gaussians in a model based on their means.
A regression tree is a clustering of Gaussian densities in an acoustic model, such that the group of ...
A class representing a vector.
KALDI_DISALLOW_COPY_AND_ASSIGN(RegressionTree)
int32 num_nodes_
Total (non-leaf+leaf) nodes.