20 #ifndef KALDI_TREE_BUILD_TREE_H_ 21 #define KALDI_TREE_BUILD_TREE_H_ 88 const std::vector<std::vector<int32> > &phone_sets,
89 const std::vector<int32> &phone2num_pdf_classes,
90 const std::vector<bool> &share_roots,
91 const std::vector<bool> &do_split,
97 bool round_num_leaves =
true);
152 const std::vector<std::vector<int32> > &phone_sets,
153 const std::vector<int32> &phone2num_pdf_classes,
154 const std::vector<bool> &share_roots,
155 const std::vector<bool> &do_split,
157 int32 max_leaves_first,
158 int32 max_leaves_second,
161 std::vector<int32> *leaf_map);
191 const std::vector<int32> &phone_ids,
192 const std::vector<int32> &hmm_lengths,
193 const std::vector<bool> &is_ctx_dep,
194 bool ensure_all_phones_covered,
203 std::vector<int32> *syms);
226 const std::vector<std::vector<int32> > &phone_sets_in,
227 const std::vector<int32> &all_pdf_classes_in,
229 std::vector<std::vector<int32> > *questions_out);
236 const std::vector<std::vector<int32> > &phone_sets_in,
237 const std::vector<int32> &all_pdf_classes_in,
240 std::vector<std::vector<int32> > *sets_out);
247 std::vector<std::vector<int32> > *phone_sets,
248 std::vector<bool> *is_shared_root,
249 std::vector<bool> *is_split_root);
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
EventMap * BuildTreeTwoLevel(Questions &qopts, const std::vector< std::vector< int32 > > &phone_sets, const std::vector< int32 > &phone2num_pdf_classes, const std::vector< bool > &share_roots, const std::vector< bool > &do_split, const BuildTreeStatsType &stats, int32 max_leaves_first, int32 max_leaves_second, bool cluster_leaves, int32 P, std::vector< int32 > *leaf_map)
BuildTreeTwoLevel builds a two-level tree, useful for example in building tied mixture systems with m...
void AutomaticallyObtainQuestions(BuildTreeStatsType &stats, const std::vector< std::vector< int32 > > &phone_sets_in, const std::vector< int32 > &all_pdf_classes_in, int32 P, std::vector< std::vector< int32 > > *questions_out)
Outputs sets of phones that are reasonable for questions to ask in the tree-building algorithm...
void GenRandStats(int32 dim, int32 num_stats, int32 N, int32 P, const std::vector< int32 > &phone_ids, const std::vector< int32 > &phone2hmm_length, const std::vector< bool > &is_ctx_dep, bool ensure_all_phones_covered, BuildTreeStatsType *stats_out)
GenRandStats generates random statistics of the form used by BuildTree.
void ReadSymbolTableAsIntegers(std::string filename, bool include_eps, std::vector< int32 > *syms)
included here because it's used in some tree-building calling code.
EventMap * BuildTree(Questions &qopts, const std::vector< std::vector< int32 > > &phone_sets, const std::vector< int32 > &phone2num_pdf_classes, const std::vector< bool > &share_roots, const std::vector< bool > &do_split, const BuildTreeStatsType &stats, BaseFloat thresh, int32 max_leaves, BaseFloat cluster_thresh, int32 P, bool round_num_leaves)
BuildTree is the normal way to build a set of decision trees.
void ReadRootsFile(std::istream &is, std::vector< std::vector< int32 > > *phone_sets, std::vector< bool > *is_shared_root, std::vector< bool > *is_split_root)
Reads the roots file (throws on error).
std::vector< std::pair< EventType, Clusterable * > > BuildTreeStatsType
void KMeansClusterPhones(BuildTreeStatsType &stats, const std::vector< std::vector< int32 > > &phone_sets_in, const std::vector< int32 > &all_pdf_classes_in, int32 P, int32 num_classes, std::vector< std::vector< int32 > > *sets_out)
This function clusters the phones (or some initially specified sets of phones) into sets of phones...