#include <nnet-compute-online.h>
Public Member Functions | |
NnetOnlineComputer (const Nnet &nnet, bool pad_input) | |
void | Compute (const CuMatrixBase< BaseFloat > &input, CuMatrix< BaseFloat > *output) |
void | Flush (CuMatrix< BaseFloat > *output) |
Private Member Functions | |
void | Propagate () |
KALDI_DISALLOW_COPY_AND_ASSIGN (NnetOnlineComputer) | |
Private Attributes | |
const Nnet & | nnet_ |
std::vector< CuMatrix< BaseFloat > > | data_ |
std::vector< ChunkInfo > | chunk_info_ |
std::vector< CuMatrix< BaseFloat > > | reusable_component_inputs_ |
CuMatrix< BaseFloat > | unprocessed_buffer_ |
CuVector< BaseFloat > | last_seen_input_frame_ |
bool | pad_input_ |
bool | is_first_chunk_ |
bool | finished_ |
Definition at line 41 of file nnet-compute-online.h.
NnetOnlineComputer | ( | const Nnet & | nnet, |
bool | pad_input | ||
) |
Definition at line 28 of file nnet-compute-online.cc.
References NnetOnlineComputer::data_, NnetOnlineComputer::nnet_, Nnet::NumComponents(), and NnetOnlineComputer::reusable_component_inputs_.
void Compute | ( | const CuMatrixBase< BaseFloat > & | input, |
CuMatrix< BaseFloat > * | output | ||
) |
Definition at line 35 of file nnet-compute-online.cc.
References NnetOnlineComputer::chunk_info_, Nnet::ComputeChunkInfo(), CuMatrixBase< Real >::CopyFromMat(), NnetOnlineComputer::data_, NnetOnlineComputer::finished_, rnnlm::i, Nnet::InputDim(), NnetOnlineComputer::is_first_chunk_, KALDI_ASSERT, KALDI_ERR, NnetOnlineComputer::last_seen_input_frame_, Nnet::LeftContext(), NnetOnlineComputer::nnet_, CuMatrixBase< Real >::NumCols(), CuMatrixBase< Real >::NumRows(), NnetOnlineComputer::pad_input_, NnetOnlineComputer::Propagate(), CuMatrixBase< Real >::Range(), CuMatrix< Real >::Resize(), NnetOnlineComputer::reusable_component_inputs_, Nnet::RightContext(), CuMatrixBase< Real >::Row(), and NnetOnlineComputer::unprocessed_buffer_.
Referenced by kaldi::nnet2::UnitTestNnetCompute().
Definition at line 120 of file nnet-compute-online.cc.
References NnetOnlineComputer::chunk_info_, Nnet::ComputeChunkInfo(), CuMatrixBase< Real >::CopyRowsFromVec(), NnetOnlineComputer::data_, NnetOnlineComputer::finished_, Nnet::InputDim(), NnetOnlineComputer::is_first_chunk_, KALDI_ASSERT, NnetOnlineComputer::last_seen_input_frame_, Nnet::LeftContext(), NnetOnlineComputer::nnet_, NnetOnlineComputer::pad_input_, NnetOnlineComputer::Propagate(), CuMatrix< Real >::Resize(), and Nnet::RightContext().
Referenced by kaldi::nnet2::UnitTestNnetCompute().
|
private |
|
private |
Definition at line 148 of file nnet-compute-online.cc.
References NnetOnlineComputer::chunk_info_, Component::Context(), NnetOnlineComputer::data_, Nnet::GetComponent(), Component::InputDim(), NnetOnlineComputer::nnet_, Nnet::NumComponents(), CuMatrixBase< Real >::NumRows(), Component::Propagate(), CuMatrixBase< Real >::Range(), CuMatrix< Real >::Resize(), NnetOnlineComputer::reusable_component_inputs_, and CuMatrixBase< Real >::RowRange().
Referenced by NnetOnlineComputer::Compute(), and NnetOnlineComputer::Flush().
|
private |
Definition at line 82 of file nnet-compute-online.h.
Referenced by NnetOnlineComputer::Compute(), NnetOnlineComputer::Flush(), and NnetOnlineComputer::Propagate().
Definition at line 80 of file nnet-compute-online.h.
Referenced by NnetOnlineComputer::Compute(), NnetOnlineComputer::Flush(), NnetOnlineComputer::NnetOnlineComputer(), and NnetOnlineComputer::Propagate().
|
private |
Definition at line 101 of file nnet-compute-online.h.
Referenced by NnetOnlineComputer::Compute(), and NnetOnlineComputer::Flush().
|
private |
Definition at line 99 of file nnet-compute-online.h.
Referenced by NnetOnlineComputer::Compute(), and NnetOnlineComputer::Flush().
Definition at line 93 of file nnet-compute-online.h.
Referenced by NnetOnlineComputer::Compute(), and NnetOnlineComputer::Flush().
|
private |
Definition at line 76 of file nnet-compute-online.h.
Referenced by NnetOnlineComputer::Compute(), NnetOnlineComputer::Flush(), NnetOnlineComputer::NnetOnlineComputer(), and NnetOnlineComputer::Propagate().
|
private |
Definition at line 97 of file nnet-compute-online.h.
Referenced by NnetOnlineComputer::Compute(), and NnetOnlineComputer::Flush().
Definition at line 85 of file nnet-compute-online.h.
Referenced by NnetOnlineComputer::Compute(), NnetOnlineComputer::NnetOnlineComputer(), and NnetOnlineComputer::Propagate().
Definition at line 89 of file nnet-compute-online.h.
Referenced by NnetOnlineComputer::Compute().