This class is responsible for arranging examples in groups that have the same strucure (i.e. More...
#include <nnet-discriminative-example.h>
Public Member Functions | |
DiscriminativeExampleMerger (const ExampleMergingConfig &config, NnetDiscriminativeExampleWriter *writer) | |
void | AcceptExample (NnetDiscriminativeExample *a) |
void | Finish () |
int32 | ExitStatus () |
~DiscriminativeExampleMerger () | |
Private Types | |
typedef unordered_map< NnetDiscriminativeExample *, std::vector< NnetDiscriminativeExample * >, NnetDiscriminativeExampleStructureHasher, NnetDiscriminativeExampleStructureCompare > | MapType |
Private Member Functions | |
void | WriteMinibatch (std::vector< NnetDiscriminativeExample > *egs) |
Private Attributes | |
bool | finished_ |
int32 | num_egs_written_ |
const ExampleMergingConfig & | config_ |
NnetDiscriminativeExampleWriter * | 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 228 of file nnet-discriminative-example.h.
|
private |
Definition at line 266 of file nnet-discriminative-example.h.
DiscriminativeExampleMerger | ( | const ExampleMergingConfig & | config, |
NnetDiscriminativeExampleWriter * | writer | ||
) |
Definition at line 446 of file nnet-discriminative-example.cc.
|
inline |
Definition at line 248 of file nnet-discriminative-example.h.
void AcceptExample | ( | NnetDiscriminativeExample * | a | ) |
Definition at line 452 of file nnet-discriminative-example.cc.
References DiscriminativeExampleMerger::config_, DiscriminativeExampleMerger::eg_to_egs_, DiscriminativeExampleMerger::finished_, kaldi::nnet3::GetNnetDiscriminativeExampleSize(), rnnlm::i, KALDI_ASSERT, ExampleMergingConfig::MinibatchSize(), and DiscriminativeExampleMerger::WriteMinibatch().
Referenced by main().
|
inline |
Definition at line 246 of file nnet-discriminative-example.h.
Referenced by main().
void Finish | ( | ) |
Definition at line 498 of file nnet-discriminative-example.cc.
References DiscriminativeExampleMerger::config_, ExampleMergingStats::DiscardedExamples(), DiscriminativeExampleMerger::eg_to_egs_, DiscriminativeExampleMerger::finished_, kaldi::nnet3::GetNnetDiscriminativeExampleSize(), rnnlm::i, KALDI_ASSERT, ExampleMergingConfig::MinibatchSize(), ExampleMergingStats::PrintStats(), DiscriminativeExampleMerger::stats_, and DiscriminativeExampleMerger::WriteMinibatch().
Referenced by main().
|
private |
Definition at line 483 of file nnet-discriminative-example.cc.
References ExampleMergingConfig::compress, DiscriminativeExampleMerger::config_, kaldi::nnet3::GetNnetDiscriminativeExampleSize(), KALDI_ASSERT, kaldi::nnet3::MergeDiscriminativeExamples(), DiscriminativeExampleMerger::num_egs_written_, DiscriminativeExampleMerger::stats_, TableWriter< Holder >::Write(), DiscriminativeExampleMerger::writer_, and ExampleMergingStats::WroteExample().
Referenced by DiscriminativeExampleMerger::AcceptExample(), and DiscriminativeExampleMerger::Finish().
|
private |
Definition at line 258 of file nnet-discriminative-example.h.
Referenced by DiscriminativeExampleMerger::AcceptExample(), DiscriminativeExampleMerger::Finish(), and DiscriminativeExampleMerger::WriteMinibatch().
|
private |
Definition at line 267 of file nnet-discriminative-example.h.
Referenced by DiscriminativeExampleMerger::AcceptExample(), and DiscriminativeExampleMerger::Finish().
|
private |
Definition at line 256 of file nnet-discriminative-example.h.
Referenced by DiscriminativeExampleMerger::AcceptExample(), and DiscriminativeExampleMerger::Finish().
|
private |
Definition at line 257 of file nnet-discriminative-example.h.
Referenced by DiscriminativeExampleMerger::WriteMinibatch().
|
private |
Definition at line 260 of file nnet-discriminative-example.h.
Referenced by DiscriminativeExampleMerger::Finish(), and DiscriminativeExampleMerger::WriteMinibatch().
|
private |
Definition at line 259 of file nnet-discriminative-example.h.
Referenced by DiscriminativeExampleMerger::WriteMinibatch().