Randomizes elements of a vector according to a mask. More...
#include <nnet-randomizer.h>
Public Member Functions | |
VectorRandomizer () | |
VectorRandomizer (const NnetDataRandomizerOptions &conf) | |
void | Init (const NnetDataRandomizerOptions &conf) |
Set the randomizer parameters (size) More... | |
void | AddData (const Vector< BaseFloat > &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 Vector< BaseFloat > & | Value () |
Returns matrix-window with next mini-batch. More... | |
Private Attributes | |
Vector< BaseFloat > | data_ |
Vector< BaseFloat > | 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 148 of file nnet-randomizer.h.
|
inline |
Definition at line 150 of file nnet-randomizer.h.
|
inlineexplicit |
Definition at line 155 of file nnet-randomizer.h.
Add data to randomization buffer.
Definition at line 114 of file nnet-randomizer.cc.
References data_, VectorBase< Real >::Dim(), and KALDI_ASSERT.
Referenced by main(), and UnitTestVectorRandomizer().
|
inline |
Returns true, if no more data for another mini-batch (after current one)
Definition at line 184 of file nnet-randomizer.h.
Referenced by UnitTestVectorRandomizer().
|
inline |
Set the randomizer parameters (size)
Definition at line 163 of file nnet-randomizer.h.
Referenced by UnitTestVectorRandomizer().
|
inline |
Returns true, when capacity is full.
Definition at line 171 of file nnet-randomizer.h.
Referenced by UnitTestVectorRandomizer().
void Next | ( | ) |
Sets cursor to next mini-batch.
Definition at line 154 of file nnet-randomizer.cc.
Referenced by main(), and UnitTestVectorRandomizer().
|
inline |
Number of frames stored inside the Randomizer.
Definition at line 176 of file nnet-randomizer.h.
References kaldi::cu::Randomize().
Referenced by UnitTestVectorRandomizer().
void Randomize | ( | const std::vector< int32 > & | mask | ) |
Randomize matrix row-order using mask.
Definition at line 142 of file nnet-randomizer.cc.
References data_, rnnlm::i, and KALDI_ASSERT.
Referenced by main(), and UnitTestVectorRandomizer().
Returns matrix-window with next mini-batch.
Definition at line 158 of file nnet-randomizer.cc.
References data_, KALDI_ASSERT, and kaldi::kUndefined.
Referenced by main(), and UnitTestVectorRandomizer().
|
private |
Definition at line 203 of file nnet-randomizer.h.
Definition at line 195 of file nnet-randomizer.h.
|
private |
A cursor, pointing to the 'row' where the next mini-batch begins,.
Definition at line 199 of file nnet-randomizer.h.
|
private |
A cursor, pointing to the 'row' after the end of data,.
Definition at line 201 of file nnet-randomizer.h.
Definition at line 196 of file nnet-randomizer.h.