#include <nnet-example-utils.h>
Public Member Functions | |
UtteranceSplitter (const ExampleGenerationConfig &config) | |
const ExampleGenerationConfig & | Config () const |
void | GetChunksForUtterance (int32 utterance_length, std::vector< ChunkTimeInfo > *chunk_info) |
bool | LengthsMatch (const std::string &utt, int32 utterance_length, int32 supervision_length, int32 length_tolerance=0) const |
~UtteranceSplitter () | |
int32 | ExitStatus () |
Private Member Functions | |
void | InitSplitForLength () |
float | DefaultDurationOfSplit (const std::vector< int32 > &split) const |
int32 | MaxUtteranceLength () const |
void | InitSplits (std::vector< std::vector< int32 > > *splits) const |
void | GetChunkSizesForUtterance (int32 utterance_length, std::vector< int32 > *chunk_sizes) const |
void | GetGapSizes (int32 utterance_length, bool enforce_subsampling_factor, const std::vector< int32 > &chunk_sizes, std::vector< int32 > *gap_sizes) const |
void | SetOutputWeights (int32 utterance_length, std::vector< ChunkTimeInfo > *chunk_info) const |
void | AccStatsForUtterance (int32 utterance_length, const std::vector< ChunkTimeInfo > &chunk_info) |
Static Private Member Functions | |
static void | DistributeRandomlyUniform (int32 n, std::vector< int32 > *vec) |
static void | DistributeRandomly (int32 n, const std::vector< int32 > &magnitudes, std::vector< int32 > *vec) |
Private Attributes | |
const ExampleGenerationConfig & | config_ |
std::vector< std::vector< std::vector< int32 > > > | splits_for_length_ |
int32 | total_num_utterances_ |
int64 | total_input_frames_ |
int64 | total_frames_overlap_ |
int64 | total_num_chunks_ |
int64 | total_frames_in_chunks_ |
std::map< int32, int32 > | chunk_size_to_count_ |
Definition at line 169 of file nnet-example-utils.h.
UtteranceSplitter | ( | const ExampleGenerationConfig & | config | ) |
Definition at line 342 of file nnet-example-utils.cc.
References UtteranceSplitter::InitSplitForLength(), KALDI_ERR, ExampleGenerationConfig::num_frames, and ExampleGenerationConfig::num_frames_str.
~UtteranceSplitter | ( | ) |
Definition at line 356 of file nnet-example-utils.cc.
References UtteranceSplitter::chunk_size_to_count_, KALDI_LOG, UtteranceSplitter::total_frames_in_chunks_, UtteranceSplitter::total_frames_overlap_, UtteranceSplitter::total_input_frames_, UtteranceSplitter::total_num_chunks_, and UtteranceSplitter::total_num_utterances_.
|
private |
Definition at line 863 of file nnet-example-utils.cc.
References UtteranceSplitter::chunk_size_to_count_, UtteranceSplitter::total_frames_in_chunks_, UtteranceSplitter::total_frames_overlap_, UtteranceSplitter::total_input_frames_, UtteranceSplitter::total_num_chunks_, and UtteranceSplitter::total_num_utterances_.
Referenced by UtteranceSplitter::GetChunksForUtterance().
|
inline |
Definition at line 175 of file nnet-example-utils.h.
Referenced by kaldi::nnet3::ProcessFile().
Definition at line 388 of file nnet-example-utils.cc.
References UtteranceSplitter::config_, rnnlm::i, KALDI_ASSERT, ExampleGenerationConfig::num_frames, and ExampleGenerationConfig::num_frames_overlap.
Referenced by UtteranceSplitter::InitSplitForLength(), and UtteranceSplitter::InitSplits().
|
staticprivate |
Definition at line 703 of file nnet-example-utils.cc.
References rnnlm::i, KALDI_ASSERT, and rnnlm::n.
Referenced by UtteranceSplitter::GetGapSizes().
Definition at line 679 of file nnet-example-utils.cc.
References rnnlm::i, and KALDI_ASSERT.
Referenced by UtteranceSplitter::GetGapSizes().
|
inline |
Definition at line 198 of file nnet-example-utils.h.
References kaldi::AccStatsForUtterance(), and rnnlm::n.
Referenced by main().
void GetChunksForUtterance | ( | int32 | utterance_length, |
std::vector< ChunkTimeInfo > * | chunk_info | ||
) |
Definition at line 822 of file nnet-example-utils.cc.
References UtteranceSplitter::AccStatsForUtterance(), UtteranceSplitter::config_, ChunkTimeInfo::first_frame, ExampleGenerationConfig::frame_subsampling_factor, UtteranceSplitter::GetChunkSizesForUtterance(), UtteranceSplitter::GetGapSizes(), rnnlm::i, KALDI_ASSERT, ExampleGenerationConfig::left_context, ChunkTimeInfo::left_context, ExampleGenerationConfig::left_context_initial, ChunkTimeInfo::num_frames, ExampleGenerationConfig::num_frames_str, ExampleGenerationConfig::right_context, ChunkTimeInfo::right_context, ExampleGenerationConfig::right_context_final, and UtteranceSplitter::SetOutputWeights().
Referenced by kaldi::nnet3::ProcessFile().
|
private |
Definition at line 580 of file nnet-example-utils.cc.
References UtteranceSplitter::config_, rnnlm::i, KALDI_ASSERT, ExampleGenerationConfig::num_frames, ExampleGenerationConfig::num_frames_overlap, kaldi::RandInt(), and UtteranceSplitter::splits_for_length_.
Referenced by UtteranceSplitter::GetChunksForUtterance().
|
private |
Definition at line 744 of file nnet-example-utils.cc.
References UtteranceSplitter::config_, UtteranceSplitter::DistributeRandomly(), UtteranceSplitter::DistributeRandomlyUniform(), ExampleGenerationConfig::frame_subsampling_factor, rnnlm::i, KALDI_ASSERT, and KALDI_ERR.
Referenced by UtteranceSplitter::GetChunksForUtterance().
|
private |
Definition at line 447 of file nnet-example-utils.cc.
References UtteranceSplitter::DefaultDurationOfSplit(), kaldi::GetVerboseLevel(), UtteranceSplitter::InitSplits(), KALDI_ASSERT, KALDI_VLOG, UtteranceSplitter::MaxUtteranceLength(), and UtteranceSplitter::splits_for_length_.
Referenced by UtteranceSplitter::UtteranceSplitter().
|
private |
Definition at line 631 of file nnet-example-utils.cc.
References UtteranceSplitter::config_, UtteranceSplitter::DefaultDurationOfSplit(), rnnlm::i, rnnlm::j, UtteranceSplitter::MaxUtteranceLength(), rnnlm::n, and ExampleGenerationConfig::num_frames.
Referenced by UtteranceSplitter::InitSplitForLength().
bool LengthsMatch | ( | const std::string & | utt, |
int32 | utterance_length, | ||
int32 | supervision_length, | ||
int32 | length_tolerance = 0 |
||
) | const |
Definition at line 553 of file nnet-example-utils.cc.
References UtteranceSplitter::config_, ExampleGenerationConfig::frame_subsampling_factor, and KALDI_WARN.
Referenced by kaldi::nnet3::ProcessFile().
|
private |
Definition at line 616 of file nnet-example-utils.cc.
References UtteranceSplitter::config_, rnnlm::i, KALDI_ASSERT, and ExampleGenerationConfig::num_frames.
Referenced by UtteranceSplitter::InitSplitForLength(), and UtteranceSplitter::InitSplits().
|
private |
Definition at line 889 of file nnet-example-utils.cc.
References UtteranceSplitter::config_, count, ChunkTimeInfo::first_frame, ExampleGenerationConfig::frame_subsampling_factor, rnnlm::i, ChunkTimeInfo::num_frames, and ChunkTimeInfo::output_weights.
Referenced by UtteranceSplitter::GetChunksForUtterance().
Definition at line 314 of file nnet-example-utils.h.
Referenced by UtteranceSplitter::AccStatsForUtterance(), and UtteranceSplitter::~UtteranceSplitter().
|
private |
Definition at line 282 of file nnet-example-utils.h.
Referenced by UtteranceSplitter::DefaultDurationOfSplit(), UtteranceSplitter::GetChunksForUtterance(), UtteranceSplitter::GetChunkSizesForUtterance(), UtteranceSplitter::GetGapSizes(), UtteranceSplitter::InitSplits(), UtteranceSplitter::LengthsMatch(), UtteranceSplitter::MaxUtteranceLength(), and UtteranceSplitter::SetOutputWeights().
|
private |
Definition at line 302 of file nnet-example-utils.h.
Referenced by UtteranceSplitter::GetChunkSizesForUtterance(), and UtteranceSplitter::InitSplitForLength().
|
private |
Definition at line 311 of file nnet-example-utils.h.
Referenced by UtteranceSplitter::AccStatsForUtterance(), and UtteranceSplitter::~UtteranceSplitter().
|
private |
Definition at line 308 of file nnet-example-utils.h.
Referenced by UtteranceSplitter::AccStatsForUtterance(), and UtteranceSplitter::~UtteranceSplitter().
|
private |
Definition at line 306 of file nnet-example-utils.h.
Referenced by UtteranceSplitter::AccStatsForUtterance(), and UtteranceSplitter::~UtteranceSplitter().
|
private |
Definition at line 310 of file nnet-example-utils.h.
Referenced by UtteranceSplitter::AccStatsForUtterance(), and UtteranceSplitter::~UtteranceSplitter().
|
private |
Definition at line 305 of file nnet-example-utils.h.
Referenced by UtteranceSplitter::AccStatsForUtterance(), and UtteranceSplitter::~UtteranceSplitter().