This class stores neural net training examples to be used in multi-threaded training. More...
#include <nnet-example.h>
Public Member Functions | |
void | AcceptExamples (std::vector< NnetExample > *examples) |
The following function is called by the code that reads in the examples, with a batch of examples. More... | |
void | ExamplesDone () |
The following function is called by the code that reads in the examples, when we're done reading examples. More... | |
bool | ProvideExamples (std::vector< NnetExample > *examples) |
This function is called by the code that does the training. More... | |
ExamplesRepository () | |
Private Member Functions | |
KALDI_DISALLOW_COPY_AND_ASSIGN (ExamplesRepository) | |
Private Attributes | |
Semaphore | full_semaphore_ |
Semaphore | empty_semaphore_ |
std::vector< NnetExample > | examples_ |
bool | done_ |
This class stores neural net training examples to be used in multi-threaded training.
Definition at line 99 of file nnet-example.h.
|
inline |
Definition at line 115 of file nnet-example.h.
void AcceptExamples | ( | std::vector< NnetExample > * | examples | ) |
The following function is called by the code that reads in the examples, with a batch of examples.
[It will empty the vector "examples").
Definition at line 209 of file nnet-example.cc.
References KALDI_ASSERT.
Referenced by kaldi::nnet2::DoBackpropParallel().
void ExamplesDone | ( | ) |
The following function is called by the code that reads in the examples, when we're done reading examples.
Definition at line 218 of file nnet-example.cc.
References KALDI_ASSERT.
Referenced by kaldi::nnet2::DoBackpropParallel().
|
private |
bool ProvideExamples | ( | std::vector< NnetExample > * | examples | ) |
This function is called by the code that does the training.
It gets the training examples, and if they are available, puts them in "examples" and returns true. It returns false when there are no examples left and ExamplesDone() has been called.
Definition at line 225 of file nnet-example.cc.
References KALDI_ASSERT.
Referenced by DoBackpropParallelClass::operator()().
|
private |
Definition at line 121 of file nnet-example.h.
|
private |
Definition at line 118 of file nnet-example.h.
|
private |
Definition at line 120 of file nnet-example.h.
|
private |
Definition at line 117 of file nnet-example.h.