This class is responsible for storing, and displaying in log messages, statistics about how examples of different sizes (c.f. More...
#include <nnet-example-utils.h>
Classes | |
struct | StatsForExampleSize |
Public Member Functions | |
void | WroteExample (int32 example_size, size_t structure_hash, int32 minibatch_size) |
Users call this function to inform this class that one minibatch has been written aggregating 'minibatch_size' separate examples of original size 'example_size' (e.g. More... | |
void | DiscardedExamples (int32 example_size, size_t structure_hash, int32 num_discarded) |
Users call this function to inform this class that after processing all the data, for examples of original size 'example_size', 'num_discarded' examples could not be put into a minibatch and were discarded. More... | |
void | PrintStats () const |
Calling this will cause a log message with information about the examples to be printed. More... | |
Private Types | |
typedef unordered_map< std::pair< int32, size_t >, StatsForExampleSize, PairHasher< int32, size_t > > | StatsType |
Private Member Functions | |
void | PrintAggregateStats () const |
void | PrintSpecificStats () const |
Private Attributes | |
StatsType | stats_ |
This class is responsible for storing, and displaying in log messages, statistics about how examples of different sizes (c.f.
GetNnetExampleSize()) were merged into minibatches, and how many examples were left over and discarded.
Definition at line 427 of file nnet-example-utils.h.
|
private |
Definition at line 464 of file nnet-example-utils.h.
Users call this function to inform this class that after processing all the data, for examples of original size 'example_size', 'num_discarded' examples could not be put into a minibatch and were discarded.
Definition at line 1065 of file nnet-example-utils.cc.
Referenced by DiscriminativeExampleMerger::Finish(), ChainExampleMerger::Finish(), and ExampleMerger::Finish().
|
private |
Definition at line 1078 of file nnet-example-utils.cc.
References KALDI_LOG, ExampleMergingStats::StatsForExampleSize::minibatch_to_num_written, and ExampleMergingStats::StatsForExampleSize::num_discarded.
|
private |
Definition at line 1142 of file nnet-example-utils.cc.
References KALDI_LOG, ExampleMergingStats::StatsForExampleSize::minibatch_to_num_written, and ExampleMergingStats::StatsForExampleSize::num_discarded.
void PrintStats | ( | ) | const |
Calling this will cause a log message with information about the examples to be printed.
Definition at line 1073 of file nnet-example-utils.cc.
Referenced by DiscriminativeExampleMerger::Finish(), ChainExampleMerger::Finish(), and ExampleMerger::Finish().
Users call this function to inform this class that one minibatch has been written aggregating 'minibatch_size' separate examples of original size 'example_size' (e.g.
as determined by GetNnetExampleSize(), but the caller does that. The 'structure_hash' is provided so that this class can distinguish between egs that have the same size but different structure. In the extremely unlikely eventuality that there is a hash collision, it will cause misleading stats to be printed out.
Definition at line 1051 of file nnet-example-utils.cc.
Referenced by DiscriminativeExampleMerger::WriteMinibatch(), ChainExampleMerger::WriteMinibatch(), and ExampleMerger::WriteMinibatch().
|
private |
Definition at line 468 of file nnet-example-utils.h.