51 if (
clat_.Start() < 0)
56 for (
int32 state = 0; state < num_states; state++) {
57 for (fst::ArcIterator<CompactLattice> aiter(
clat_, state);
58 !aiter.Done(); aiter.Next()) {
63 "Bad arc posterior in forward-backward computation");
64 if (arc_loglike > 0.0) arc_loglike = 0.0;
65 int32 num_frames = arc.weight.String().size(),
69 os << utterance <<
'\t' <<
state_times_[state] <<
'\t' << num_frames
70 <<
'\t' << arc_post <<
'\t' << word;
73 const std::vector<int32> &ali = arc.weight.String();
74 for (
int32 frame = 0; frame < num_frames; frame++) {
76 if (frame + 1 < num_frames) os <<
',';
82 const std::vector<int32> &ali = arc.weight.String();
83 bool first_phone =
true;
84 for (
int32 frame = 0; frame < num_frames; frame++) {
86 if (first_phone) first_phone =
false;
std::vector< int32 > state_times_
std::vector< double > alpha_
bool ComputeCompactLatticeBetas(const CompactLattice &clat, vector< double > *beta)
double ConvertToCost(const LatticeWeightTpl< Float > &w)
int32 CompactLatticeStateTimes(const CompactLattice &lat, vector< int32 > *times)
As LatticeStateTimes, but in the CompactLattice format.
#define KALDI_ASSERT(cond)
fst::ArcTpl< CompactLatticeWeight > CompactLatticeArc
std::vector< double > beta_
bool ComputeCompactLatticeAlphas(const CompactLattice &clat, vector< double > *alpha)
bool IsFinal(int32 trans_id) const
int32 TransitionIdToPhone(int32 trans_id) const
const CompactLattice & clat_
const TransitionModel * trans_model_