Skip to content

Conversation

@desh2608
Copy link
Contributor

No description provided.

@danpovey
Copy link
Contributor

Thanks! There seems to be a compilation error in lattice-simple-decoder.cc though, from the travis buld.

@desh2608
Copy link
Contributor Author

@danpovey oh alright, I'll try to fix it.

@dophist
Copy link
Contributor

dophist commented Aug 25, 2018

We have already had all frontier token in the queue, why do we add tokens(with epsilon ilabel) again? Just from a quick skim, not for sure. Should this check be done in the first place of queue's push_back() ?

}
}

for (const Elem *e = toks_.GetList(); e != NULL; e = e->tail) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @dophist is right; you need to replace the loop at line 812 with this.

queue.push_back(iter->first);
best_cost = std::min(best_cost, iter->second->tot_cost);
StateId key = iter->first;
if (fst_->NumInputEpsilons(key) != 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vimalmanohar I'm getting an error here because of this method. Can you help with this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like fst_ is not a pointer. In Dan's PR, it was changed to a pointer. So here you need to use fst_.

@desh2608
Copy link
Contributor Author

@danpovey I think it can be merged now.

queue_.push_back(e->key);
for (const Elem *e = toks_.GetList(); e != NULL; e = e->tail) {
StateId key = e->key;
if (fst_.NumInputEpsilons(key) != 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is another place where this check should be done, in the loop below this, before you push to the queue. (applies to all the decoders).

StateId key = iter->first;
if (fst_.NumInputEpsilons(key) != 0) {
queue.push_back(key);
best_cost = std::min(best_cost, iter->second->tot_cost);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the assignment of best_cost should not be inside the if-statement. Check that in my original PR I did not make this mistake.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay. Actually the PR did not have changes in the lattice-simple-decoder, so I figured the best_cost is only over those objects which are actually being pushed to the queue. Anyway, I'll make this change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The idea is to make the code equivalent to what it was before (but faster). The best_cost is over all live tokens, which includes states that don't have epsilon transitions frm them.

for (const Elem *e = toks_.GetList(); e != NULL; e = e->tail)
queue_.push_back(e->key);
for (const Elem *e = toks_.GetList(); e != NULL; e = e->tail) {
StateId key = e->key;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, I think it would be clearer if this variable were named state, and not key. I know it was key in my branch; I'll fix the conflict later.

@danpovey danpovey merged commit 1242305 into kaldi-asr:master Aug 30, 2018
dpriver pushed a commit to dpriver/kaldi that referenced this pull request Sep 13, 2018
…() (kaldi-asr#2641)

Note: in one configuration I saw 25% speedup with this change (depends on beams, etc.)
Skaiste pushed a commit to Skaiste/idlak that referenced this pull request Sep 26, 2018
…() (kaldi-asr#2641)

Note: in one configuration I saw 25% speedup with this change (depends on beams, etc.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants