21 #ifndef KALDI_DECODER_DECODABLE_MATRIX_H_ 22 #define KALDI_DECODER_DECODABLE_MATRIX_H_ 42 KALDI_ERR <<
"DecodableMatrixScaledMapped: mismatch, matrix has " 43 << likes.
NumCols() <<
" cols but transition-model has " 55 KALDI_ERR <<
"DecodableMatrixScaledMapped: mismatch, matrix has " 56 << likes->
NumCols() <<
" cols but transition-model has " 105 int32 frame_offset = 0);
111 int32 frame_offset = 0);
155 trans_model_(tm), frame_offset_(0), input_is_finished_(false) { }
167 int32 frames_to_discard);
172 return loglikes_.NumRows() + frame_offset_;
182 #ifdef KALDI_PARANOID 183 return loglikes_(frame - frame_offset_, pdf_id);
186 return raw_data_[frame * stride_ + pdf_id];
229 KALDI_ERR <<
"Invalid (frame, index - 1) = (" 230 << frame <<
", " << index - 1 <<
") for matrix of size " 245 #endif // KALDI_DECODER_DECODABLE_MATRIX_H_ const TransitionModel & trans_model_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
virtual int32 NumFramesReady() const
The call NumFramesReady() will return the number of frames currently available for this decodable obj...
virtual int32 NumFramesReady() const
The call NumFramesReady() will return the number of frames currently available for this decodable obj...
virtual BaseFloat LogLikelihood(int32 frame, int32 index)
Returns the log likelihood, which will be negated in the decoder.
KALDI_DISALLOW_COPY_AND_ASSIGN(DecodableMatrixScaledMapped)
DecodableInterface provides a link between the (acoustic-modeling and feature-processing) code and th...
virtual int32 NumIndices() const
Returns the number of states in the acoustic model (they will be indexed one-based, i.e.
DecodableMatrixScaled(const Matrix< BaseFloat > &likes, BaseFloat scale)
const TransitionModel & trans_model_
MatrixIndexT NumCols() const
Returns number of columns (or zero for empty matrix).
int32 TransitionIdToPdfFast(int32 trans_id) const
Base class which provides matrix operations not involving resizing or allocation. ...
virtual ~DecodableMatrixMappedOffset()
const BaseFloat * raw_data_
virtual ~DecodableMatrixScaledMapped()
const Matrix< BaseFloat > * likes_to_delete_
virtual bool IsLastFrame(int32 frame) const
Returns true if this is the last frame.
This decodable class returns log-likes stored in a matrix; it supports repeatedly writing to the matr...
DecodableMatrixScaledMapped(const TransitionModel &tm, BaseFloat scale, const Matrix< BaseFloat > *likes)
DecodableMatrixScaledMapped(const TransitionModel &tm, const Matrix< BaseFloat > &likes, BaseFloat scale)
int32 NumTransitionIds() const
Returns the total number of transition-ids (note, these are one-based).
const Matrix< BaseFloat > & likes_
int32 FirstAvailableFrame() const
virtual int32 NumIndices() const
Returns the number of states in the acoustic model (they will be indexed one-based, i.e.
virtual bool IsLastFrame(int32 frame) const
Returns true if this is the last frame.
virtual BaseFloat LogLikelihood(int32 frame, int32 tid)
Returns the log likelihood, which will be negated in the decoder.
const Matrix< BaseFloat > * likes_
#define KALDI_ASSERT(cond)
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).
const MatrixBase< BaseFloat > * likes_
virtual bool IsLastFrame(int32 frame) const
Returns true if this is the last frame.
const TransitionModel & trans_model_
This is like DecodableMatrixScaledMapped, but it doesn't support an acoustic scale, and it does support a frame offset, whereby you can state that the first row of 'likes' is actually the n'th row of the matrix of available log-likelihoods.
DecodableMatrixMappedOffset(const TransitionModel &tm)
virtual int32 NumFramesReady() const
The call NumFramesReady() will return the number of frames currently available for this decodable obj...
virtual BaseFloat LogLikelihood(int32 frame, int32 tid)
Returns the log likelihood, which will be negated in the decoder.
virtual int32 NumIndices() const
Returns the number of states in the acoustic model (they will be indexed one-based, i.e.
Matrix< BaseFloat > loglikes_