#include <online-decodable.h>
Public Member Functions | |
OnlineDecodableDiagGmmScaled (const AmDiagGmm &am, const TransitionModel &trans_model, const BaseFloat scale, OnlineFeatureMatrix *input_feats) | |
virtual BaseFloat | LogLikelihood (int32 frame, int32 index) |
Returns the log likelihood, which will be negated in the decoder. More... | |
virtual bool | IsLastFrame (int32 frame) const |
Returns true if this is the last frame. More... | |
virtual int32 | NumIndices () const |
Indices are one-based! This is for compatibility with OpenFst. More... | |
Public Member Functions inherited from DecodableInterface | |
virtual int32 | NumFramesReady () const |
The call NumFramesReady() will return the number of frames currently available for this decodable object. More... | |
virtual | ~DecodableInterface () |
Private Member Functions | |
void | CacheFrame (int32 frame) |
KALDI_DISALLOW_COPY_AND_ASSIGN (OnlineDecodableDiagGmmScaled) | |
Private Attributes | |
OnlineFeatureMatrix * | features_ |
const AmDiagGmm & | ac_model_ |
BaseFloat | ac_scale_ |
const TransitionModel & | trans_model_ |
const int32 | feat_dim_ |
Vector< BaseFloat > | cur_feats_ |
int32 | cur_frame_ |
std::vector< std::pair< int32, BaseFloat > > | cache_ |
Definition at line 35 of file online-decodable.h.
OnlineDecodableDiagGmmScaled | ( | const AmDiagGmm & | am, |
const TransitionModel & | trans_model, | ||
const BaseFloat | scale, | ||
OnlineFeatureMatrix * | input_feats | ||
) |
Definition at line 27 of file online-decodable.cc.
References OnlineDecodableDiagGmmScaled::cache_, OnlineFeatureMatrix::IsValidFrame(), KALDI_ERR, TransitionModel::NumPdfs(), and OnlineDecodableDiagGmmScaled::trans_model_.
|
private |
Definition at line 43 of file online-decodable.cc.
References OnlineDecodableDiagGmmScaled::cur_feats_, OnlineDecodableDiagGmmScaled::cur_frame_, OnlineDecodableDiagGmmScaled::feat_dim_, OnlineDecodableDiagGmmScaled::features_, OnlineFeatureMatrix::GetFrame(), OnlineFeatureMatrix::IsValidFrame(), KALDI_ASSERT, and KALDI_ERR.
Referenced by OnlineDecodableDiagGmmScaled::LogLikelihood(), and OnlineDecodableDiagGmmScaled::NumIndices().
Returns true if this is the last frame.
Frames are zero-based, so the first frame is zero. IsLastFrame(-1) will return false, unless the file is empty (which is a case that I'm not sure all the code will handle, so be careful). Caution: the behavior of this function in an online setting is being changed somewhat. In future it may return false in cases where we haven't yet decided to terminate decoding, but later true if we decide to terminate decoding. The plan in future is to rely more on NumFramesReady(), and in future, IsLastFrame() would always return false in an online-decoding setting, and would only return true in a decoding-from-matrix setting where we want to allow the last delta or LDA features to be flushed out for compatibility with the baseline setup.
Implements DecodableInterface.
Definition at line 66 of file online-decodable.cc.
References OnlineDecodableDiagGmmScaled::features_, and OnlineFeatureMatrix::IsValidFrame().
|
private |
Returns the log likelihood, which will be negated in the decoder.
Implements DecodableInterface.
Definition at line 53 of file online-decodable.cc.
References OnlineDecodableDiagGmmScaled::ac_model_, OnlineDecodableDiagGmmScaled::ac_scale_, OnlineDecodableDiagGmmScaled::cache_, OnlineDecodableDiagGmmScaled::CacheFrame(), OnlineDecodableDiagGmmScaled::cur_feats_, OnlineDecodableDiagGmmScaled::cur_frame_, AmDiagGmm::LogLikelihood(), OnlineDecodableDiagGmmScaled::trans_model_, and TransitionModel::TransitionIdToPdf().
|
inlinevirtual |
Indices are one-based! This is for compatibility with OpenFst.
Implements DecodableInterface.
Definition at line 49 of file online-decodable.h.
References OnlineDecodableDiagGmmScaled::CacheFrame(), TransitionModel::NumTransitionIds(), and OnlineDecodableDiagGmmScaled::trans_model_.
|
private |
Definition at line 55 of file online-decodable.h.
Referenced by OnlineDecodableDiagGmmScaled::LogLikelihood().
|
private |
Definition at line 56 of file online-decodable.h.
Referenced by OnlineDecodableDiagGmmScaled::LogLikelihood().
Definition at line 61 of file online-decodable.h.
Referenced by OnlineDecodableDiagGmmScaled::LogLikelihood(), and OnlineDecodableDiagGmmScaled::OnlineDecodableDiagGmmScaled().
Definition at line 59 of file online-decodable.h.
Referenced by OnlineDecodableDiagGmmScaled::CacheFrame(), and OnlineDecodableDiagGmmScaled::LogLikelihood().
|
private |
Definition at line 60 of file online-decodable.h.
Referenced by OnlineDecodableDiagGmmScaled::CacheFrame(), and OnlineDecodableDiagGmmScaled::LogLikelihood().
|
private |
Definition at line 58 of file online-decodable.h.
Referenced by OnlineDecodableDiagGmmScaled::CacheFrame().
|
private |
Definition at line 54 of file online-decodable.h.
Referenced by OnlineDecodableDiagGmmScaled::CacheFrame(), and OnlineDecodableDiagGmmScaled::IsLastFrame().
|
private |
Definition at line 57 of file online-decodable.h.
Referenced by OnlineDecodableDiagGmmScaled::LogLikelihood(), OnlineDecodableDiagGmmScaled::NumIndices(), and OnlineDecodableDiagGmmScaled::OnlineDecodableDiagGmmScaled().