#include <decodable-am-diag-gmm-regtree.h>
Public Member Functions | |
DecodableAmDiagGmmRegtreeFmllr (const AmDiagGmm &am, const TransitionModel &tm, const Matrix< BaseFloat > &feats, const RegtreeFmllrDiagGmm &fmllr_xform, const RegressionTree ®tree, BaseFloat scale, BaseFloat log_sum_exp_prune=-1.0) | |
virtual BaseFloat | LogLikelihood (int32 frame, int32 tid) |
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... | |
Public Member Functions inherited from DecodableAmDiagGmmUnmapped | |
DecodableAmDiagGmmUnmapped (const AmDiagGmm &am, const Matrix< BaseFloat > &feats, BaseFloat log_sum_exp_prune=-1.0) | |
If you set log_sum_exp_prune to a value greater than 0 it will prune in the LogSumExp operation (larger = more exact); I suggest 5. More... | |
virtual bool | IsLastFrame (int32 frame) const |
Returns true if this is the last frame. More... | |
Public Member Functions inherited from DecodableInterface | |
virtual | ~DecodableInterface () |
Protected Member Functions | |
virtual BaseFloat | LogLikelihoodZeroBased (int32 frame, int32 state_index) |
const TransitionModel * | TransModel () |
Protected Member Functions inherited from DecodableAmDiagGmmUnmapped | |
void | ResetLogLikeCache () |
Private Member Functions | |
KALDI_DISALLOW_COPY_AND_ASSIGN (DecodableAmDiagGmmRegtreeFmllr) | |
Private Attributes | |
const TransitionModel & | trans_model_ |
BaseFloat | scale_ |
const RegtreeFmllrDiagGmm & | fmllr_xform_ |
const RegressionTree & | regtree_ |
std::vector< Vector< BaseFloat > > | xformed_data_ |
std::vector< Vector< BaseFloat > > | xformed_data_squared_ |
Vector< BaseFloat > | logdets_ |
bool | valid_logdets_ |
Additional Inherited Members | |
Protected Attributes inherited from DecodableAmDiagGmmUnmapped | |
const AmDiagGmm & | acoustic_model_ |
const Matrix< BaseFloat > & | feature_matrix_ |
int32 | previous_frame_ |
BaseFloat | log_sum_exp_prune_ |
std::vector< LikelihoodCacheRecord > | log_like_cache_ |
Definition at line 38 of file decodable-am-diag-gmm-regtree.h.
|
inline |
Definition at line 40 of file decodable-am-diag-gmm-regtree.h.
|
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.
Reimplemented from DecodableAmDiagGmmUnmapped.
Definition at line 52 of file decodable-am-diag-gmm-regtree.h.
References DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased(), DecodableAmDiagGmmRegtreeFmllr::scale_, DecodableAmDiagGmmRegtreeFmllr::trans_model_, and TransitionModel::TransitionIdToPdfFast().
Reimplemented from DecodableAmDiagGmmUnmapped.
Definition at line 29 of file decodable-am-diag-gmm-regtree.cc.
References DecodableAmDiagGmmUnmapped::acoustic_model_, RegtreeFmllrDiagGmm::Base2RegClass(), VectorBase< Real >::Dim(), DiagGmm::Dim(), DecodableAmDiagGmmUnmapped::feature_matrix_, DecodableAmDiagGmmRegtreeFmllr::fmllr_xform_, RegressionTree::Gauss2BaseclassId(), DiagGmm::gconsts(), RegtreeFmllrDiagGmm::GetLogDets(), AmDiagGmm::GetPdf(), DiagGmm::inv_vars(), KALDI_ASSERT, KALDI_ERR, KALDI_ISINF, KALDI_ISNAN, DecodableAmDiagGmmUnmapped::log_like_cache_, DecodableAmDiagGmmUnmapped::log_sum_exp_prune_, DecodableAmDiagGmmRegtreeFmllr::logdets_, DiagGmm::means_invvars(), DecodableAmDiagGmmRegtreeFmllr::NumFramesReady(), DiagGmm::NumGauss(), DecodableAmDiagGmmRegtreeFmllr::NumIndices(), RegtreeFmllrDiagGmm::NumRegClasses(), DecodableAmDiagGmmUnmapped::previous_frame_, DecodableAmDiagGmmRegtreeFmllr::regtree_, MatrixBase< Real >::Row(), RegtreeFmllrDiagGmm::TransformFeature(), DiagGmm::valid_gconsts(), DecodableAmDiagGmmRegtreeFmllr::valid_logdets_, kaldi::VecVec(), DecodableAmDiagGmmRegtreeFmllr::xformed_data_, and DecodableAmDiagGmmRegtreeFmllr::xformed_data_squared_.
Referenced by DecodableAmDiagGmmRegtreeFmllr::LogLikelihood(), DecodableAmDiagGmmRegtreeMllr::LogLikelihood(), DecodableAmDiagGmmRegtreeFmllr::NumIndices(), and DecodableAmDiagGmmRegtreeMllr::TransModel().
|
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 DecodableAmDiagGmmUnmapped.
Definition at line 57 of file decodable-am-diag-gmm-regtree.h.
References DecodableAmDiagGmmUnmapped::feature_matrix_, and MatrixBase< Real >::NumRows().
Referenced by DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased(), DecodableAmDiagGmmRegtreeMllr::LogLikelihoodZeroBased(), and 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).
Reimplemented from DecodableAmDiagGmmUnmapped.
Definition at line 60 of file decodable-am-diag-gmm-regtree.h.
References DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased(), TransitionModel::NumTransitionIds(), and DecodableAmDiagGmmRegtreeFmllr::trans_model_.
Referenced by DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased(), and DecodableAmDiagGmmRegtreeMllr::LogLikelihoodZeroBased().
|
inlineprotected |
Definition at line 65 of file decodable-am-diag-gmm-regtree.h.
References DecodableAmDiagGmmRegtreeFmllr::trans_model_.
|
private |
Definition at line 70 of file decodable-am-diag-gmm-regtree.h.
Referenced by DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased().
Definition at line 74 of file decodable-am-diag-gmm-regtree.h.
Referenced by DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased().
|
private |
Definition at line 71 of file decodable-am-diag-gmm-regtree.h.
Referenced by DecodableAmDiagGmmRegtreeMllr::GetXformedMeanInvVars(), and DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased().
|
private |
Definition at line 69 of file decodable-am-diag-gmm-regtree.h.
Referenced by DecodableAmDiagGmmRegtreeFmllr::LogLikelihood(), and DecodableAmDiagGmmRegtreeMllr::LogLikelihood().
|
private |
Definition at line 68 of file decodable-am-diag-gmm-regtree.h.
Referenced by DecodableAmDiagGmmRegtreeFmllr::LogLikelihood(), DecodableAmDiagGmmRegtreeMllr::LogLikelihood(), DecodableAmDiagGmmRegtreeFmllr::NumIndices(), DecodableAmDiagGmmRegtreeMllr::NumIndices(), DecodableAmDiagGmmRegtreeFmllr::TransModel(), and DecodableAmDiagGmmRegtreeMllr::TransModel().
|
private |
Definition at line 75 of file decodable-am-diag-gmm-regtree.h.
Referenced by DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased().
Definition at line 72 of file decodable-am-diag-gmm-regtree.h.
Referenced by DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased().
Definition at line 73 of file decodable-am-diag-gmm-regtree.h.
Referenced by DecodableAmDiagGmmRegtreeFmllr::LogLikelihoodZeroBased().