Commit 6fca69cd authored by Dan Povey's avatar Dan Povey
Browse files

Minor, mostly cosmetic fixes to some lattice and SGMM programs.

git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@456 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent e378b3eb
......@@ -69,8 +69,6 @@ int main(int argc, char *argv[]) {
kaldi::uint64 props = lat.Properties(fst::kFstProperties, false);
if (!(props & fst::kTopSorted)) {
KALDI_WARN << "Utterance " << key << ": Supplied lattice not "
<< "topologically sorted. Sorting it.";
if (fst::TopSort(&lat) == false)
KALDI_ERR << "Cycles detected in lattice.";
}
......
......@@ -26,8 +26,8 @@ int main(int argc, char *argv[]) {
typedef kaldi::int32 int32;
const char *usage =
"Initialize an SGMM from a trained full-covariance UBM and a specified"
" model topology.\n"
"Compute \"pre-transform\" parameters required for estimating fMLLR with\n"
"SGMMs, and write to a model file, after the SGMM.\n"
"Usage: sgmm-comp-prexform [options] <sgmm-in> <occs-in> <sgmm-out>\n";
bool binary = false;
......
......@@ -41,15 +41,17 @@ void LatticeAcousticRescore(const AmSgmm& am,
KALDI_ERR << "Input lattice must be topologically sorted.";
KALDI_ASSERT(!state_times.empty());
int32 max_time = *std::max_element(state_times.begin(), state_times.end());
KALDI_ASSERT(max_time > 0);
std::vector<std::vector<int32> > time_to_state(max_time+1);
std::vector<std::vector<int32> > time_to_state(data.NumRows());
for (size_t i = 0; i < state_times.size(); i++) {
KALDI_ASSERT(state_times[i] >= 0);
time_to_state[state_times[i]].push_back(i);
if (state_times[i] < data.NumRows()) // end state may be past this..
time_to_state[state_times[i]].push_back(i);
else
KALDI_ASSERT(state_times[i] == data.NumRows()
&& "There appears to be lattice/feature mismatch.");
}
for (int32 t = 0; t <= max_time; t++) {
for (int32 t = 0; t < data.NumRows(); t++) {
SgmmPerFrameDerivedVars per_frame_vars;
std::vector<int32> this_gselect;
if (!gselect.empty()) {
......@@ -98,9 +100,9 @@ int main(int argc, char *argv[]) {
const char *usage =
"Replace the acoustic scores on a lattice using a new model.\n"
"Usage: gmm-resocre-lattice [options] <model-in> <lattice-rspecifier> "
"Usage: sgmm-rescore-lattice [options] <model-in> <lattice-rspecifier> "
"<feature-rspecifier> <lattice-wspecifier>\n"
" e.g.: gmm-resocre-lattice 1.mdl ark:1.lats scp:trn.scp ark:2.lats\n";
" e.g.: sgmm-rescore-lattice 1.mdl ark:1.lats scp:trn.scp ark:2.lats\n";
kaldi::BaseFloat old_acoustic_scale = 0.0;
BaseFloat log_prune = 5.0;
......
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