This namespace contains things needed for the implementation of the function NnetBatchComputer::SplitUtteranceIntoTasks(). More...
Functions | |
void | GetOutputFrameInfoForTasks (const NnetBatchComputerOptions &opts, int32 num_subsampled_frames, int32 num_subsampled_frames_per_chunk, std::vector< NnetInferenceTask > *tasks) |
This function figures out how many chunks are needed for this utterance, sets 'tasks' to a vector with that many elements, and sets up the following elements in 'tasks': output_t_stride num_output_frames num_initial_unused_output_frames num_used_output_frames. More... | |
void | AddOnlineIvectorsToTasks (const NnetBatchComputerOptions &opts, const CuMatrix< BaseFloat > &online_ivectors, int32 online_ivector_period, std::vector< NnetInferenceTask > *tasks) |
static void | SplitInputToTasks (const NnetBatchComputerOptions &opts, int32 nnet_left_context, int32 nnet_right_context, const CuMatrix< BaseFloat > &input, std::vector< NnetInferenceTask > *tasks) |
This function sets up the 'input' and 'first_input_t' and 'is_edge' members of the 'tasks' array; it is responsible for working out, for each task, which input frames it needs (including left-context and right-context). More... | |
This namespace contains things needed for the implementation of the function NnetBatchComputer::SplitUtteranceIntoTasks().
void kaldi::nnet3::utterance_splitting::AddOnlineIvectorsToTasks | ( | const NnetBatchComputerOptions & | opts, |
const CuMatrix< BaseFloat > & | online_ivectors, | ||
int32 | online_ivector_period, | ||
std::vector< NnetInferenceTask > * | tasks | ||
) |
Definition at line 729 of file nnet-batch-compute.cc.
References NnetInferenceTask::first_used_output_frame_index, NnetSimpleComputationOptions::frame_subsampling_factor, rnnlm::i, NnetInferenceTask::ivector, KALDI_ERR, NnetInferenceTask::num_initial_unused_output_frames, NnetInferenceTask::num_output_frames, CuMatrixBase< Real >::NumRows(), and CuMatrixBase< Real >::Row().
Referenced by NnetBatchComputer::SplitUtteranceIntoTasks().
void kaldi::nnet3::utterance_splitting::GetOutputFrameInfoForTasks | ( | const NnetBatchComputerOptions & | opts, |
int32 | num_subsampled_frames, | ||
int32 | num_subsampled_frames_per_chunk, | ||
std::vector< NnetInferenceTask > * | tasks | ||
) |
This function figures out how many chunks are needed for this utterance, sets 'tasks' to a vector with that many elements, and sets up the following elements in 'tasks': output_t_stride num_output_frames num_initial_unused_output_frames num_used_output_frames.
[in] | opts | Options class |
[in] | num_subsampled_frames | The number of output frames in this utterance. Must be > 0. |
[in] | num_subsampled_frames_per_chunk | The number of output frames per chunk |
[out] | The | 'tasks' array is output to here; it will have one task per chunk, with only the members 'output_t_stride', 'num_output_frames', 'num_initial_unused_output_frames', 'num_used_output_frames' and 'is_irregular' set up. |
Definition at line 661 of file nnet-batch-compute.cc.
References NnetBatchComputerOptions::ensure_exact_final_context, NnetInferenceTask::first_used_output_frame_index, NnetSimpleComputationOptions::frame_subsampling_factor, rnnlm::i, NnetInferenceTask::is_irregular, KALDI_ASSERT, NnetInferenceTask::num_initial_unused_output_frames, NnetInferenceTask::num_output_frames, and NnetInferenceTask::num_used_output_frames.
Referenced by NnetBatchComputer::SplitUtteranceIntoTasks().
|
static |
This function sets up the 'input' and 'first_input_t' and 'is_edge' members of the 'tasks' array; it is responsible for working out, for each task, which input frames it needs (including left-context and right-context).
The 'nnet_left_context' and 'nnet_right_context' are the inherent left and right context of the network (num-frames required on left and right to compute an output frame), and may be computed by doing: ComputeSimpleNnetContext(nnet, &nnet_left_context_, &nnet_right_context_)
Definition at line 779 of file nnet-batch-compute.cc.
References NnetSimpleComputationOptions::extra_left_context, NnetSimpleComputationOptions::extra_left_context_initial, NnetSimpleComputationOptions::extra_right_context, NnetSimpleComputationOptions::extra_right_context_final, NnetInferenceTask::first_input_t, NnetInferenceTask::first_used_output_frame_index, NnetSimpleComputationOptions::frame_subsampling_factor, rnnlm::i, NnetInferenceTask::input, NnetInferenceTask::is_edge, kaldi::kUndefined, NnetInferenceTask::num_initial_unused_output_frames, NnetInferenceTask::num_output_frames, CuMatrixBase< Real >::NumCols(), and CuMatrixBase< Real >::NumRows().
Referenced by NnetBatchComputer::SplitUtteranceIntoTasks().