Public Member Functions | |
NnetExampleBackgroundReader (int32 minibatch_size, Nnet *nnet, SequentialNnetExampleReader *reader) | |
~NnetExampleBackgroundReader () | |
void | ReadExamples () |
bool | GetNextMinibatch (std::vector< NnetExample > *examples, Matrix< BaseFloat > *formatted_examples, double *total_weight) |
Static Public Member Functions | |
static void * | Run (void *ptr_in) |
Private Attributes | |
int32 | minibatch_size_ |
Nnet * | nnet_ |
SequentialNnetExampleReader * | reader_ |
std::thread | thread_ |
std::vector< NnetExample > | examples_ |
Matrix< BaseFloat > | formatted_examples_ |
double | total_weight_ |
Semaphore | producer_semaphore_ |
Semaphore | consumer_semaphore_ |
bool | finished_ |
Definition at line 27 of file train-nnet.cc.
|
inline |
Definition at line 29 of file train-nnet.cc.
References NnetExampleBackgroundReader::consumer_semaphore_, NnetExampleBackgroundReader::Run(), Semaphore::Signal(), and NnetExampleBackgroundReader::thread_.
|
inline |
Definition at line 41 of file train-nnet.cc.
References KALDI_ERR, and NnetExampleBackgroundReader::thread_.
|
inline |
Definition at line 104 of file train-nnet.cc.
References NnetExampleBackgroundReader::consumer_semaphore_, NnetExampleBackgroundReader::examples_, NnetExampleBackgroundReader::finished_, NnetExampleBackgroundReader::formatted_examples_, KALDI_ASSERT, NnetExampleBackgroundReader::producer_semaphore_, Semaphore::Signal(), Matrix< Real >::Swap(), NnetExampleBackgroundReader::total_weight_, and Semaphore::Wait().
Referenced by kaldi::nnet2::TrainNnetSimple().
|
inline |
Definition at line 49 of file train-nnet.cc.
References NnetExampleBackgroundReader::consumer_semaphore_, SequentialTableReader< Holder >::Done(), NnetExampleBackgroundReader::examples_, kaldi::nnet2::FormatNnetInput(), NnetExampleBackgroundReader::formatted_examples_, KALDI_ASSERT, NnetExampleBackgroundReader::minibatch_size_, SequentialTableReader< Holder >::Next(), NnetExampleBackgroundReader::nnet_, NnetExampleBackgroundReader::producer_semaphore_, NnetExampleBackgroundReader::reader_, Matrix< Real >::Resize(), Semaphore::Signal(), NnetExampleBackgroundReader::total_weight_, kaldi::nnet2::TotalNnetTrainingWeight(), SequentialTableReader< Holder >::Value(), and Semaphore::Wait().
Referenced by NnetExampleBackgroundReader::Run().
|
inlinestatic |
Definition at line 94 of file train-nnet.cc.
References NnetExampleBackgroundReader::ReadExamples().
Referenced by NnetExampleBackgroundReader::NnetExampleBackgroundReader().
|
private |
Definition at line 140 of file train-nnet.cc.
Referenced by NnetExampleBackgroundReader::GetNextMinibatch(), NnetExampleBackgroundReader::NnetExampleBackgroundReader(), and NnetExampleBackgroundReader::ReadExamples().
|
private |
Definition at line 134 of file train-nnet.cc.
Referenced by NnetExampleBackgroundReader::GetNextMinibatch(), and NnetExampleBackgroundReader::ReadExamples().
|
private |
Definition at line 142 of file train-nnet.cc.
Referenced by NnetExampleBackgroundReader::GetNextMinibatch().
Definition at line 135 of file train-nnet.cc.
Referenced by NnetExampleBackgroundReader::GetNextMinibatch(), and NnetExampleBackgroundReader::ReadExamples().
|
private |
Definition at line 129 of file train-nnet.cc.
Referenced by NnetExampleBackgroundReader::ReadExamples().
|
private |
Definition at line 130 of file train-nnet.cc.
Referenced by NnetExampleBackgroundReader::ReadExamples().
|
private |
Definition at line 139 of file train-nnet.cc.
Referenced by NnetExampleBackgroundReader::GetNextMinibatch(), and NnetExampleBackgroundReader::ReadExamples().
|
private |
Definition at line 131 of file train-nnet.cc.
Referenced by NnetExampleBackgroundReader::ReadExamples().
|
private |
Definition at line 132 of file train-nnet.cc.
Referenced by NnetExampleBackgroundReader::NnetExampleBackgroundReader(), and NnetExampleBackgroundReader::~NnetExampleBackgroundReader().
|
private |
Definition at line 136 of file train-nnet.cc.
Referenced by NnetExampleBackgroundReader::GetNextMinibatch(), and NnetExampleBackgroundReader::ReadExamples().