#include <decodable-simple-looped.h>
Public Member Functions | |
DecodableAmNnetSimpleLooped (const DecodableNnetSimpleLoopedInfo &info, const TransitionModel &trans_model, const MatrixBase< BaseFloat > &feats, const VectorBase< BaseFloat > *ivector=NULL, const MatrixBase< BaseFloat > *online_ivectors=NULL, int32 online_ivector_period=1) | |
This constructor takes features as input, and you can either supply a single iVector input, estimated in batch-mode ('ivector'), or 'online' iVectors ('online_ivectors' and 'online_ivector_period', or none at all. More... | |
virtual BaseFloat | LogLikelihood (int32 frame, int32 transition_id) |
Returns the log likelihood, which will be negated in the decoder. 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 |
Returns the number of states in the acoustic model (they will be indexed one-based, i.e. More... | |
virtual bool | IsLastFrame (int32 frame) const |
Returns true if this is the last frame. More... | |
Public Member Functions inherited from DecodableInterface | |
virtual | ~DecodableInterface () |
Private Member Functions | |
KALDI_DISALLOW_COPY_AND_ASSIGN (DecodableAmNnetSimpleLooped) | |
Private Attributes | |
DecodableNnetSimpleLooped | decodable_nnet_ |
const TransitionModel & | trans_model_ |
Definition at line 267 of file decodable-simple-looped.h.
DecodableAmNnetSimpleLooped | ( | const DecodableNnetSimpleLoopedInfo & | info, |
const TransitionModel & | trans_model, | ||
const MatrixBase< BaseFloat > & | feats, | ||
const VectorBase< BaseFloat > * | ivector = NULL , |
||
const MatrixBase< BaseFloat > * | online_ivectors = NULL , |
||
int32 | online_ivector_period = 1 |
||
) |
This constructor takes features as input, and you can either supply a single iVector input, estimated in batch-mode ('ivector'), or 'online' iVectors ('online_ivectors' and 'online_ivector_period', or none at all.
Note: it stores references to all arguments to the constructor, so don't delete them till this goes out of scope.
[in] | info | This helper class contains all the static pre-computed information this class needs, and contains a pointer to the neural net. If you want prior subtraction to be done, you should have initialized this with the constructor that takes class AmNnetSimple. |
[in] | trans_model | The transition model to use. This takes care of the mapping from transition-id (which is an arg to LogLikelihood()) to pdf-id (which is used internally). |
[in] | feats | A pointer to the input feature matrix; must be non-NULL. We |
[in] | ivector | If you are using iVectors estimated in batch mode, a pointer to the iVector, else NULL. |
[in] | ivector | If you are using iVectors estimated in batch mode, a pointer to the iVector, else NULL. |
[in] | online_ivectors | If you are using iVectors estimated 'online' a pointer to the iVectors, else NULL. |
[in] | online_ivector_period | If you are using iVectors estimated 'online' (i.e. if online_ivectors != NULL) gives the periodicity (in frames) with which the iVectors are estimated. |
Definition at line 245 of file decodable-simple-looped.cc.
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 313 of file decodable-simple-looped.h.
References KALDI_ASSERT, and KALDI_DISALLOW_COPY_AND_ASSIGN.
|
private |
Returns the log likelihood, which will be negated in the decoder.
The "frame" starts from zero. You should verify that NumFramesReady() > frame before calling this.
Implements DecodableInterface.
Definition at line 255 of file decodable-simple-looped.cc.
References DecodableAmNnetSimpleLooped::decodable_nnet_, DecodableNnetSimpleLooped::GetOutput(), DecodableAmNnetSimpleLooped::trans_model_, and TransitionModel::TransitionIdToPdfFast().
|
inlinevirtual |
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 307 of file decodable-simple-looped.h.
Referenced by main().
|
inlinevirtual |
Returns the number of states in the acoustic model (they will be indexed one-based, i.e.
from 1 to NumIndices(); this is for compatibility with OpenFst).
Implements DecodableInterface.
Definition at line 311 of file decodable-simple-looped.h.
|
private |
Definition at line 320 of file decodable-simple-looped.h.
Referenced by DecodableAmNnetSimpleLooped::LogLikelihood().
|
private |
Definition at line 321 of file decodable-simple-looped.h.
Referenced by DecodableAmNnetSimpleLooped::LogLikelihood().