DecodableAmNnetLoopedOnline Class Reference

#include <decodable-online-looped.h>

Inheritance diagram for DecodableAmNnetLoopedOnline:
Collaboration diagram for DecodableAmNnetLoopedOnline:

Public Member Functions

 DecodableAmNnetLoopedOnline (const TransitionModel &trans_model, const DecodableNnetSimpleLoopedInfo &info, OnlineFeatureInterface *input_features, OnlineFeatureInterface *ivector_features)
 
virtual int32 NumIndices () const
 Returns the number of states in the acoustic model (they will be indexed one-based, i.e. More...
 
virtual BaseFloat LogLikelihood (int32 subsampled_frame, int32 transition_id)
 Returns the log likelihood, which will be negated in the decoder. More...
 
- Public Member Functions inherited from DecodableNnetLoopedOnlineBase
 DecodableNnetLoopedOnlineBase (const DecodableNnetSimpleLoopedInfo &info, OnlineFeatureInterface *input_features, OnlineFeatureInterface *ivector_features)
 
virtual bool IsLastFrame (int32 subsampled_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...
 
int32 FrameSubsamplingFactor () const
 
void SetFrameOffset (int32 frame_offset)
 Sets the frame offset value. More...
 
int32 GetFrameOffset () const
 Returns the frame offset value. More...
 
- Public Member Functions inherited from DecodableInterface
virtual ~DecodableInterface ()
 

Private Member Functions

 KALDI_DISALLOW_COPY_AND_ASSIGN (DecodableAmNnetLoopedOnline)
 

Private Attributes

const TransitionModeltrans_model_
 

Additional Inherited Members

- Protected Member Functions inherited from DecodableNnetLoopedOnlineBase
void EnsureFrameIsComputed (int32 subsampled_frame)
 If the neural-network outputs for this frame are not cached, this function computes them (and possibly also some later frames). More...
 
- Protected Attributes inherited from DecodableNnetLoopedOnlineBase
Matrix< BaseFloatcurrent_log_post_
 
int32 num_chunks_computed_
 
int32 current_log_post_subsampled_offset_
 
const DecodableNnetSimpleLoopedInfoinfo_
 
int32 frame_offset_
 

Detailed Description

Definition at line 183 of file decodable-online-looped.h.

Constructor & Destructor Documentation

◆ DecodableAmNnetLoopedOnline()

DecodableAmNnetLoopedOnline ( const TransitionModel trans_model,
const DecodableNnetSimpleLoopedInfo info,
OnlineFeatureInterface input_features,
OnlineFeatureInterface ivector_features 
)
inline

Definition at line 185 of file decodable-online-looped.h.

189  :
190  DecodableNnetLoopedOnlineBase(info, input_features, ivector_features),
191  trans_model_(trans_model) { }
DecodableNnetLoopedOnlineBase(const DecodableNnetSimpleLoopedInfo &info, OnlineFeatureInterface *input_features, OnlineFeatureInterface *ivector_features)

Member Function Documentation

◆ KALDI_DISALLOW_COPY_AND_ASSIGN()

KALDI_DISALLOW_COPY_AND_ASSIGN ( DecodableAmNnetLoopedOnline  )
private

◆ LogLikelihood()

BaseFloat LogLikelihood ( int32  frame,
int32  index 
)
virtual

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 249 of file decodable-online-looped.cc.

References DecodableNnetLoopedOnlineBase::current_log_post_, DecodableNnetLoopedOnlineBase::current_log_post_subsampled_offset_, DecodableNnetLoopedOnlineBase::EnsureFrameIsComputed(), and DecodableNnetLoopedOnlineBase::frame_offset_.

250  {
251  subsampled_frame += frame_offset_;
252  EnsureFrameIsComputed(subsampled_frame);
253  return current_log_post_(
254  subsampled_frame - current_log_post_subsampled_offset_,
256 }
int32 TransitionIdToPdfFast(int32 trans_id) const
void EnsureFrameIsComputed(int32 subsampled_frame)
If the neural-network outputs for this frame are not cached, this function computes them (and possibl...

◆ NumIndices()

virtual int32 NumIndices ( ) const
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 195 of file decodable-online-looped.h.

References DecodableInterface::LogLikelihood().

195 { return trans_model_.NumTransitionIds(); }
int32 NumTransitionIds() const
Returns the total number of transition-ids (note, these are one-based).

Member Data Documentation

◆ trans_model_

const TransitionModel& trans_model_
private

Definition at line 203 of file decodable-online-looped.h.


The documentation for this class was generated from the following files: