28 trans_model_(tm), likes_(&likes), likes_to_delete_(NULL),
29 frame_offset_(frame_offset) {
35 << likes.
NumCols() <<
" cols but transition-model has " 48 << likes->
NumCols() <<
" cols but transition-model has " 83 if (loglikes->
NumRows() == 0)
return;
86 frames_to_discard >= 0);
87 if (frames_to_discard == loglikes_.NumRows()) {
88 loglikes_.Swap(loglikes);
91 int32 old_rows_kept = loglikes_.NumRows() - frames_to_discard,
92 new_num_rows = old_rows_kept + loglikes->
NumRows();
94 new_loglikes.
RowRange(0, old_rows_kept).CopyFromMat(
95 loglikes_.RowRange(frames_to_discard, old_rows_kept));
96 new_loglikes.RowRange(old_rows_kept, loglikes->
NumRows()).CopyFromMat(
98 loglikes_.Swap(&new_loglikes);
const TransitionModel & trans_model_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
virtual int32 NumIndices() const
Returns the number of states in the acoustic model (they will be indexed one-based, i.e.
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. ...
const Real * Data() const
Gives pointer to raw data (const).
virtual int32 NumFramesReady() const
The call NumFramesReady() will return the number of frames currently available for this decodable obj...
virtual bool IsLastFrame(int32 frame) const
Returns true if this is the last frame.
const BaseFloat * raw_data_
const Matrix< BaseFloat > * likes_to_delete_
virtual ~DecodableMatrixMapped()
MatrixIndexT Stride() const
Stride (distance in memory between each row). Will be >= NumCols.
DecodableMatrixMapped(const TransitionModel &tm, const MatrixBase< BaseFloat > &likes, int32 frame_offset=0)
int32 NumTransitionIds() const
Returns the total number of transition-ids (note, these are one-based).
SubMatrix< Real > RowRange(const MatrixIndexT row_offset, const MatrixIndexT num_rows) const
#define KALDI_ASSERT(cond)
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).
const MatrixBase< BaseFloat > * likes_
void Resize(const MatrixIndexT r, const MatrixIndexT c, MatrixResizeType resize_type=kSetZero, MatrixStrideType stride_type=kDefaultStride)
Sets matrix to a specified size (zero is OK as long as both r and c are zero).
virtual BaseFloat LogLikelihood(int32 frame, int32 tid)
Returns the log likelihood, which will be negated in the decoder.
void AcceptLoglikes(Matrix< BaseFloat > *loglikes, int32 frames_to_discard)