Commit d82f2b38 authored by Korbinian Riedhammer's avatar Korbinian Riedhammer
Browse files

cosmetic changes to logging/error handling

git-svn-id: https://svn.code.sf.net/p/kaldi/code/sandbox/discrim@443 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent 0ae97960
......@@ -154,7 +154,7 @@ void TiedGmm::Write(std::ostream &out_stream, bool binary) const {
if (!binary) out_stream << "\n";
WriteMarker(out_stream, binary, "<PDF_INDEX>");
WriteBasicType(out_stream, binary, pdf_index_);
if (!binary) out_stream << "\n";
// if (!binary) out_stream << "\n";
WriteMarker(out_stream, binary, "<WEIGHTS>");
weights_.Write(out_stream, binary);
WriteMarker(out_stream, binary, "</TIEDGMM>");
......
......@@ -169,7 +169,6 @@ try {
bool binary = false;
bool full = true;
bool split_gaussians = false;
BaseFloat perturb = 0.01;
......@@ -183,9 +182,6 @@ try {
po.Register("binary", &binary, "Write output in binary mode");
po.Register("max-gauss", &max_num_gaussians, "Maximum number of total "
"gaussians to allocate (including all codebooks.)");
po.Register("split-gaussians", &split_gaussians, "If the resulting "
"codebook(s) have a total number of gaussians less then the max"
" split the components");
po.Register("perturb", &perturb, "Perturbation factor for gaussian "
"splitting.");
po.Register("min-gauss", &min_num_gaussians, "Minimum number of gaussians "
......
......@@ -311,7 +311,10 @@ static bool GetTreeStructureInternal(
|| leaf < 0) return false;
if (static_cast<int32>(leaf_parents->size()) <= leaf)
leaf_parents->resize(leaf+1, NULL);
if ((*leaf_parents)[leaf] != NULL) return false; // repeated leaf.
if ((*leaf_parents)[leaf] != NULL) {
KALDI_WARN << "Repeated leaf! Did you suppress leaf clustering when building the tree?";
return false; // repeated leaf.
}
(*leaf_parents)[leaf] = parent;
} else {
nonleaf_nodes->push_back(child);
......@@ -322,8 +325,11 @@ static bool GetTreeStructureInternal(
}
for (size_t i = 0; i < leaf_parents->size(); i++)
if ((*leaf_parents)[i] == NULL) return false; // non-consecutively
// numbered leaves.
if ((*leaf_parents)[i] == NULL) {
KALDI_WARN << "non-consecutively numbered leaves";
return false;
}
// non-consecutively numbered leaves.
KALDI_ASSERT(!leaf_parents->empty()); // or no leaves.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment