#include <online-gmm-decodable.h>
Public Member Functions | |
DecodableDiagGmmScaledOnline (const AmDiagGmm &am, const TransitionModel &trans_model, const BaseFloat scale, OnlineFeatureInterface *input_feats) | |
virtual BaseFloat | LogLikelihood (int32 frame, int32 index) |
Returns the scaled log likelihood. More... | |
virtual bool | IsLastFrame (int32 frame) const |
Returns true if this is the last frame. More... | |
virtual int32 | NumFramesReady () const |
The call NumFramesReady() will return the number of frames currently available for this decodable object. More... | |
virtual int32 | NumIndices () const |
Indices are one-based! This is for compatibility with OpenFst. More... | |
Public Member Functions inherited from DecodableInterface | |
virtual | ~DecodableInterface () |
Private Member Functions | |
void | CacheFrame (int32 frame) |
KALDI_DISALLOW_COPY_AND_ASSIGN (DecodableDiagGmmScaledOnline) | |
Private Attributes | |
OnlineFeatureInterface * | 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-gmm-decodable.h.
DecodableDiagGmmScaledOnline | ( | const AmDiagGmm & | am, |
const TransitionModel & | trans_model, | ||
const BaseFloat | scale, | ||
OnlineFeatureInterface * | input_feats | ||
) |
Definition at line 26 of file online-gmm-decodable.cc.
References DecodableDiagGmmScaledOnline::cache_, TransitionModel::NumPdfs(), and DecodableDiagGmmScaledOnline::trans_model_.
|
private |
Definition at line 37 of file online-gmm-decodable.cc.
References DecodableDiagGmmScaledOnline::cur_feats_, DecodableDiagGmmScaledOnline::cur_frame_, DecodableDiagGmmScaledOnline::features_, and OnlineFeatureInterface::GetFrame().
Referenced by DecodableDiagGmmScaledOnline::LogLikelihood(), and DecodableDiagGmmScaledOnline::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 58 of file online-gmm-decodable.cc.
References DecodableDiagGmmScaledOnline::features_, and OnlineFeatureInterface::IsLastFrame().
|
private |
Returns the scaled log likelihood.
Implements DecodableInterface.
Definition at line 45 of file online-gmm-decodable.cc.
References DecodableDiagGmmScaledOnline::ac_model_, DecodableDiagGmmScaledOnline::ac_scale_, DecodableDiagGmmScaledOnline::cache_, DecodableDiagGmmScaledOnline::CacheFrame(), DecodableDiagGmmScaledOnline::cur_feats_, DecodableDiagGmmScaledOnline::cur_frame_, AmDiagGmm::LogLikelihood(), DecodableDiagGmmScaledOnline::trans_model_, and TransitionModel::TransitionIdToPdf().
|
virtual |
The call NumFramesReady() will return the number of frames currently available for this decodable object.
This is for use in setups where you don't want the decoder to block while waiting for input. This is newly added as of Jan 2014, and I hope, going forward, to rely on this mechanism more than IsLastFrame to know when to stop decoding.
Reimplemented from DecodableInterface.
Definition at line 62 of file online-gmm-decodable.cc.
References DecodableDiagGmmScaledOnline::features_, and OnlineFeatureInterface::NumFramesReady().
|
inlinevirtual |
Indices are one-based! This is for compatibility with OpenFst.
Implements DecodableInterface.
Definition at line 51 of file online-gmm-decodable.h.
References DecodableDiagGmmScaledOnline::CacheFrame(), TransitionModel::NumTransitionIds(), and DecodableDiagGmmScaledOnline::trans_model_.
|
private |
Definition at line 57 of file online-gmm-decodable.h.
Referenced by DecodableDiagGmmScaledOnline::LogLikelihood().
|
private |
Definition at line 58 of file online-gmm-decodable.h.
Referenced by DecodableDiagGmmScaledOnline::LogLikelihood().
Definition at line 63 of file online-gmm-decodable.h.
Referenced by DecodableDiagGmmScaledOnline::DecodableDiagGmmScaledOnline(), and DecodableDiagGmmScaledOnline::LogLikelihood().
Definition at line 61 of file online-gmm-decodable.h.
Referenced by DecodableDiagGmmScaledOnline::CacheFrame(), and DecodableDiagGmmScaledOnline::LogLikelihood().
|
private |
Definition at line 62 of file online-gmm-decodable.h.
Referenced by DecodableDiagGmmScaledOnline::CacheFrame(), and DecodableDiagGmmScaledOnline::LogLikelihood().
|
private |
Definition at line 60 of file online-gmm-decodable.h.
|
private |
Definition at line 56 of file online-gmm-decodable.h.
Referenced by DecodableDiagGmmScaledOnline::CacheFrame(), DecodableDiagGmmScaledOnline::IsLastFrame(), and DecodableDiagGmmScaledOnline::NumFramesReady().
|
private |
Definition at line 59 of file online-gmm-decodable.h.
Referenced by DecodableDiagGmmScaledOnline::DecodableDiagGmmScaledOnline(), DecodableDiagGmmScaledOnline::LogLikelihood(), and DecodableDiagGmmScaledOnline::NumIndices().