This class is responsible for arranging examples in groups that have the same strucure (i.e. More...
#include <nnet-chain-example.h>
Public Member Functions | |
ChainExampleMerger (const ExampleMergingConfig &config, NnetChainExampleWriter *writer) | |
void | AcceptExample (NnetChainExample *a) |
void | Finish () |
int32 | ExitStatus () |
~ChainExampleMerger () | |
Private Types | |
typedef unordered_map< NnetChainExample *, std::vector< NnetChainExample * >, NnetChainExampleStructureHasher, NnetChainExampleStructureCompare > | MapType |
Private Member Functions | |
void | WriteMinibatch (std::vector< NnetChainExample > *egs) |
Private Attributes | |
bool | finished_ |
int32 | num_egs_written_ |
const ExampleMergingConfig & | config_ |
NnetChainExampleWriter * | 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 234 of file nnet-chain-example.h.
|
private |
Definition at line 272 of file nnet-chain-example.h.
ChainExampleMerger | ( | const ExampleMergingConfig & | config, |
NnetChainExampleWriter * | writer | ||
) |
Definition at line 453 of file nnet-chain-example.cc.
|
inline |
Definition at line 254 of file nnet-chain-example.h.
void AcceptExample | ( | NnetChainExample * | a | ) |
Definition at line 459 of file nnet-chain-example.cc.
References ChainExampleMerger::config_, ChainExampleMerger::eg_to_egs_, ChainExampleMerger::finished_, kaldi::nnet3::GetNnetChainExampleSize(), rnnlm::i, KALDI_ASSERT, ExampleMergingConfig::MinibatchSize(), and ChainExampleMerger::WriteMinibatch().
|
inline |
Definition at line 252 of file nnet-chain-example.h.
void Finish | ( | ) |
Definition at line 505 of file nnet-chain-example.cc.
References ChainExampleMerger::config_, ExampleMergingStats::DiscardedExamples(), ChainExampleMerger::eg_to_egs_, ChainExampleMerger::finished_, kaldi::nnet3::GetNnetChainExampleSize(), rnnlm::i, KALDI_ASSERT, ExampleMergingConfig::MinibatchSize(), ExampleMergingStats::PrintStats(), ChainExampleMerger::stats_, and ChainExampleMerger::WriteMinibatch().
|
private |
Definition at line 490 of file nnet-chain-example.cc.
References ExampleMergingConfig::compress, ChainExampleMerger::config_, kaldi::nnet3::GetNnetChainExampleSize(), KALDI_ASSERT, kaldi::nnet3::MergeChainExamples(), ChainExampleMerger::num_egs_written_, ChainExampleMerger::stats_, TableWriter< Holder >::Write(), ChainExampleMerger::writer_, and ExampleMergingStats::WroteExample().
Referenced by ChainExampleMerger::AcceptExample(), and ChainExampleMerger::Finish().
|
private |
Definition at line 264 of file nnet-chain-example.h.
Referenced by ChainExampleMerger::AcceptExample(), ChainExampleMerger::Finish(), and ChainExampleMerger::WriteMinibatch().
|
private |
Definition at line 273 of file nnet-chain-example.h.
Referenced by ChainExampleMerger::AcceptExample(), and ChainExampleMerger::Finish().
|
private |
Definition at line 262 of file nnet-chain-example.h.
Referenced by ChainExampleMerger::AcceptExample(), and ChainExampleMerger::Finish().
|
private |
Definition at line 263 of file nnet-chain-example.h.
Referenced by ChainExampleMerger::WriteMinibatch().
|
private |
Definition at line 266 of file nnet-chain-example.h.
Referenced by ChainExampleMerger::Finish(), and ChainExampleMerger::WriteMinibatch().
|
private |
Definition at line 265 of file nnet-chain-example.h.
Referenced by ChainExampleMerger::WriteMinibatch().