Randomizes elements of a vector according to a mask. More...
#include <nnet-randomizer.h>
Public Member Functions | |
StdVectorRandomizer () | |
StdVectorRandomizer (const NnetDataRandomizerOptions &conf) | |
void | Init (const NnetDataRandomizerOptions &conf) |
Set the randomizer parameters (size) More... | |
void | AddData (const std::vector< T > &v) |
Add data to randomization buffer. More... | |
bool | IsFull () |
Returns true, when capacity is full. More... | |
int32 | NumFrames () |
Number of frames stored inside the Randomizer. More... | |
void | Randomize (const std::vector< int32 > &mask) |
Randomize matrix row-order using mask. More... | |
bool | Done () |
Returns true, if no more data for another mini-batch (after current one) More... | |
void | Next () |
Sets cursor to next mini-batch. More... | |
const std::vector< T > & | Value () |
Returns matrix-window with next mini-batch. More... | |
Private Attributes | |
std::vector< T > | data_ |
std::vector< T > | minibatch_ |
int32 | data_begin_ |
A cursor, pointing to the 'row' where the next mini-batch begins,. More... | |
int32 | data_end_ |
A cursor, pointing to the 'row' after the end of data,. More... | |
NnetDataRandomizerOptions | conf_ |
Randomizes elements of a vector according to a mask.
Definition at line 209 of file nnet-randomizer.h.
|
inline |
Definition at line 211 of file nnet-randomizer.h.
|
inlineexplicit |
Definition at line 216 of file nnet-randomizer.h.
void AddData | ( | const std::vector< T > & | v | ) |
Add data to randomization buffer.
Definition at line 171 of file nnet-randomizer.cc.
References data_, and KALDI_ASSERT.
Referenced by main(), and UnitTestStdVectorRandomizer().
|
inline |
Returns true, if no more data for another mini-batch (after current one)
Definition at line 245 of file nnet-randomizer.h.
Referenced by UnitTestStdVectorRandomizer().
|
inline |
Set the randomizer parameters (size)
Definition at line 224 of file nnet-randomizer.h.
Referenced by UnitTestStdVectorRandomizer().
|
inline |
Returns true, when capacity is full.
Definition at line 232 of file nnet-randomizer.h.
Referenced by UnitTestStdVectorRandomizer().
void Next | ( | ) |
Sets cursor to next mini-batch.
Definition at line 211 of file nnet-randomizer.cc.
Referenced by main(), and UnitTestStdVectorRandomizer().
|
inline |
Number of frames stored inside the Randomizer.
Definition at line 237 of file nnet-randomizer.h.
References kaldi::cu::Randomize().
Referenced by UnitTestStdVectorRandomizer().
void Randomize | ( | const std::vector< int32 > & | mask | ) |
Randomize matrix row-order using mask.
Definition at line 198 of file nnet-randomizer.cc.
References data_, rnnlm::i, and KALDI_ASSERT.
Referenced by main(), and UnitTestStdVectorRandomizer().
const std::vector< T > & Value | ( | ) |
Returns matrix-window with next mini-batch.
Definition at line 216 of file nnet-randomizer.cc.
References data_, and KALDI_ASSERT.
Referenced by main(), and UnitTestStdVectorRandomizer().
|
private |
Definition at line 264 of file nnet-randomizer.h.
|
private |
Definition at line 256 of file nnet-randomizer.h.
|
private |
A cursor, pointing to the 'row' where the next mini-batch begins,.
Definition at line 260 of file nnet-randomizer.h.
|
private |
A cursor, pointing to the 'row' after the end of data,.
Definition at line 262 of file nnet-randomizer.h.
|
private |
Definition at line 257 of file nnet-randomizer.h.