30 features_(input_feats), ac_model_(am),
31 ac_scale_(scale), trans_model_(trans_model),
32 feat_dim_(input_feats->Dim()), cur_frame_(-1) {
36 KALDI_ERR <<
"Attempt to initialize decodable object with empty " 37 <<
"input: please check this before the initializer!";
40 cache_.resize(num_pdfs, std::pair<int32,BaseFloat>(-1, 0.0));
47 KALDI_ERR <<
"Request for invalid frame (you need to check IsLastFrame, or, " 48 <<
"for frame zero, check that the input is valid.";
57 if (
cache_[pdf_id].first == frame)
58 return cache_[pdf_id].second;
60 cache_[pdf_id].first = frame;
61 cache_[pdf_id].second = ans;
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
OnlineDecodableDiagGmmScaled(const AmDiagGmm &am, const TransitionModel &trans_model, const BaseFloat scale, OnlineFeatureMatrix *input_feats)
std::vector< std::pair< int32, BaseFloat > > cache_
int32 TransitionIdToPdf(int32 trans_id) const
const TransitionModel & trans_model_
const AmDiagGmm & ac_model_
BaseFloat LogLikelihood(const int32 pdf_index, const VectorBase< BaseFloat > &data) const
void CacheFrame(int32 frame)
SubVector< BaseFloat > GetFrame(int32 frame)
#define KALDI_ASSERT(cond)
virtual BaseFloat LogLikelihood(int32 frame, int32 index)
Returns the log likelihood, which will be negated in the decoder.
virtual bool IsLastFrame(int32 frame) const
Returns true if this is the last frame.
OnlineFeatureMatrix * features_
Vector< BaseFloat > cur_feats_
bool IsValidFrame(int32 frame)