Hello,
I wanted to understand how how graph and acoustic costs are calculated in the decoding process. Thus, I added the following lines highlighted by Blue to see what it prints. It looks like StateId doesn't have graph cost and acoustic cost all the times. I can see the costs per word id (i.e. 2:197174 = 16.0992,-30.9669 | 6719:198772 = 7.19654,-15.4476 | 56757:102087 = 20.1372,-41.4124). Are there any reasons not saving them all the times? If not, could help me understand how come if I am misleading? Also, I would like to understand why the graph cost comes positive. I guess the acoustic cost would be in a form of log probability but the graph cost seems to be not or continuously added somehow in the graph.
Thanks in advance,
Homin
template<class Arc, class I>
bool GetLinearSymbolSequence(const Fst<Arc> &fst,
vector<I> *isymbols_out,
vector<I> *osymbols_out,
typename Arc::Weight *tot_weight_out) {
typedef typename Arc::StateId StateId;
typedef typename Arc::Weight Weight;
Weight tot_weight = Weight::One();
vector<I> ilabel_seq;
vector<I> olabel_seq;
StateId cur_state = fst.Start();
...
while (1) {
Weight w = fst.Final(cur_state);
if (w != Weight::Zero()) { // is final..
...
} else {
...
ArcIterator<Fst<Arc> > iter(fst, cur_state); // get the only arc.
const Arc &arc = iter.Value();
tot_weight = Times(arc.weight, tot_weight);
std::cerr << arc.ilabel << ":" << arc.olabel << " = " << arc.weight << std::endl;
...
}
}
}
LOG (online2-wav-nnet3-latgen-faster[5.2.107~4-e8928]:ComputeDerivedVars():ivector-extractor.cc:183) Computing derived variables for iVector extractor
LOG (online2-wav-nnet3-latgen-faster[5.2.107~4-e8928]:ComputeDerivedVars():ivector-extractor.cc:204) Done.
LOG (online2-wav-nnet3-latgen-faster[5.2.107~4-e8928]:RemoveSomeNodes():nnet-nnet.cc:916) Removed 2 orphan nodes.
LOG (online2-wav-nnet3-latgen-faster[5.2.107~4-e8928]:RemoveOrphanComponents():nnet-nnet.cc:841) Removing 2 orphan components.
LOG (online2-wav-nnet3-latgen-faster[5.2.107~4-e8928]:Collapse():nnet-utils.cc:770) Added 1 components, removed 2
LOG (online2-wav-nnet3-latgen-faster[5.2.107~4-e8928]:CompileLooped():nnet-compile-looped.cc:336) Spent 0.211483 seconds in looped compilation.
wav-copy scp,p:/home/kwon/tiny_testset_en/PE-test_hires/split1/1/wav.scp ark:-
LOG (wav-copy[5.2.107~4-e8928]:main():wav-copy.cc:68) Copied 1 wave files
extend-wav-with-silence ark:- ark:-
LOG (extend-wav-with-silence[5.2.107~4-e8928]:main():extend-wav-with-silence.cc:107) Successfully extended 1 files.
2:197174 = 16.0992,-30.9669
12510:0 = 0,0
12509:0 = 0,0
12509:0 = 0,0
12509:0 = 0,0
33638:0 = 0,0
33637:0 = 0,0
31814:0 = 0,0
30492:0 = 0,0
30491:0 = 0,0
6720:0 = 0,0
6719:198772 = 7.19654,-15.4476
45504:0 = 0,0
45503:0 = 0,0
45503:0 = 0,0
45503:0 = 0,0
56758:0 = 0,0
56757:0 = 0,0
56757:102087 = 20.1372,-41.4124
18576:0 = 0,0
18575:0 = 0,0
18575:0 = 0,0
2:0 = 0,0
43656:0 = 0,0
43655:0 = 0,0
43655:0 = 0,0
22602:0 = 0,0