This class is responsible for arranging examples in groups that have the same strucure (i.e. More...
#include <nnet-example-utils.h>
Public Member Functions | |
ExampleMerger (const ExampleMergingConfig &config, NnetExampleWriter *writer) | |
void | AcceptExample (NnetExample *a) |
void | Finish () |
int32 | ExitStatus () |
~ExampleMerger () | |
Private Types | |
typedef unordered_map< NnetExample *, std::vector< NnetExample * >, NnetExampleStructureHasher, NnetExampleStructureCompare > | MapType |
Private Member Functions | |
void | WriteMinibatch (const std::vector< NnetExample > &egs) |
Private Attributes | |
bool | finished_ |
int32 | num_egs_written_ |
const ExampleMergingConfig & | config_ |
NnetExampleWriter * | writer_ |
ExampleMergingStats | stats_ |
MapType | eg_to_egs_ |
This class is responsible for arranging examples in groups that have the same strucure (i.e.
the same input and output indexes), and outputting them in suitable minibatches as defined by ExampleMergingConfig.
Definition at line 480 of file nnet-example-utils.h.
|
private |
Definition at line 515 of file nnet-example-utils.h.
ExampleMerger | ( | const ExampleMergingConfig & | config, |
NnetExampleWriter * | writer | ||
) |
Definition at line 1188 of file nnet-example-utils.cc.
|
inline |
Definition at line 500 of file nnet-example-utils.h.
void AcceptExample | ( | NnetExample * | a | ) |
Definition at line 1194 of file nnet-example-utils.cc.
References ExampleMerger::config_, ExampleMerger::eg_to_egs_, ExampleMerger::finished_, kaldi::nnet3::GetNnetExampleSize(), rnnlm::i, KALDI_ASSERT, ExampleMergingConfig::MinibatchSize(), and ExampleMerger::WriteMinibatch().
Referenced by main().
|
inline |
Definition at line 498 of file nnet-example-utils.h.
Referenced by main().
void Finish | ( | ) |
Definition at line 1239 of file nnet-example-utils.cc.
References ExampleMerger::config_, ExampleMergingStats::DiscardedExamples(), ExampleMerger::eg_to_egs_, ExampleMerger::finished_, kaldi::nnet3::GetNnetExampleSize(), rnnlm::i, KALDI_ASSERT, ExampleMergingConfig::MinibatchSize(), ExampleMergingStats::PrintStats(), ExampleMerger::stats_, and ExampleMerger::WriteMinibatch().
Referenced by main().
|
private |
Definition at line 1225 of file nnet-example-utils.cc.
References ExampleMergingConfig::compress, ExampleMerger::config_, kaldi::nnet3::GetNnetExampleSize(), KALDI_ASSERT, kaldi::nnet3::MergeExamples(), ExampleMerger::num_egs_written_, ExampleMerger::stats_, TableWriter< Holder >::Write(), ExampleMerger::writer_, and ExampleMergingStats::WroteExample().
Referenced by ExampleMerger::AcceptExample(), and ExampleMerger::Finish().
|
private |
Definition at line 508 of file nnet-example-utils.h.
Referenced by ExampleMerger::AcceptExample(), ExampleMerger::Finish(), and ExampleMerger::WriteMinibatch().
|
private |
Definition at line 516 of file nnet-example-utils.h.
Referenced by ExampleMerger::AcceptExample(), and ExampleMerger::Finish().
|
private |
Definition at line 506 of file nnet-example-utils.h.
Referenced by ExampleMerger::AcceptExample(), and ExampleMerger::Finish().
|
private |
Definition at line 507 of file nnet-example-utils.h.
Referenced by ExampleMerger::WriteMinibatch().
|
private |
Definition at line 510 of file nnet-example-utils.h.
Referenced by ExampleMerger::Finish(), and ExampleMerger::WriteMinibatch().
|
private |
Definition at line 509 of file nnet-example-utils.h.
Referenced by ExampleMerger::WriteMinibatch().