Shuffles rows of a matrix according to the indices in the mask,. More...
#include <nnet-randomizer.h>
Public Member Functions | |
MatrixRandomizer () | |
MatrixRandomizer (const NnetDataRandomizerOptions &conf) | |
void | Init (const NnetDataRandomizerOptions &conf) |
Set the randomizer parameters (size) More... | |
void | AddData (const CuMatrixBase< BaseFloat > &m) |
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 CuMatrixBase< BaseFloat > & | Value () |
Returns matrix-window with next mini-batch. More... | |
Private Attributes | |
CuMatrix< BaseFloat > | data_ |
CuMatrix< BaseFloat > | data_aux_ |
CuMatrix< 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_ |
Shuffles rows of a matrix according to the indices in the mask,.
Definition at line 87 of file nnet-randomizer.h.
|
inline |
Definition at line 89 of file nnet-randomizer.h.
|
inlineexplicit |
Definition at line 94 of file nnet-randomizer.h.
void AddData | ( | const CuMatrixBase< BaseFloat > & | m | ) |
Add data to randomization buffer.
Definition at line 47 of file nnet-randomizer.cc.
References data_, KALDI_ASSERT, CuMatrixBase< Real >::NumCols(), MatrixBase< Real >::NumRows(), and CuMatrixBase< Real >::NumRows().
Referenced by main(), and UnitTestMatrixRandomizer().
|
inline |
Returns true, if no more data for another mini-batch (after current one)
Definition at line 123 of file nnet-randomizer.h.
Referenced by main(), and UnitTestMatrixRandomizer().
|
inline |
Set the randomizer parameters (size)
Definition at line 102 of file nnet-randomizer.h.
Referenced by UnitTestMatrixRandomizer().
|
inline |
Returns true, when capacity is full.
Definition at line 110 of file nnet-randomizer.h.
Referenced by main(), and UnitTestMatrixRandomizer().
void Next | ( | ) |
Sets cursor to next mini-batch.
Definition at line 98 of file nnet-randomizer.cc.
Referenced by main(), and UnitTestMatrixRandomizer().
|
inline |
Number of frames stored inside the Randomizer.
Definition at line 115 of file nnet-randomizer.h.
References kaldi::cu::Randomize().
Referenced by main(), and UnitTestMatrixRandomizer().
void Randomize | ( | const std::vector< int32 > & | mask | ) |
Randomize matrix row-order using mask.
Definition at line 79 of file nnet-randomizer.cc.
References CuArray< T >::CopyFromVec(), data_, KALDI_ASSERT, and kaldi::cu::Randomize().
Referenced by main(), and UnitTestMatrixRandomizer().
const CuMatrixBase< BaseFloat > & Value | ( | ) |
Returns matrix-window with next mini-batch.
Definition at line 102 of file nnet-randomizer.cc.
References data_, KALDI_ASSERT, and kaldi::kUndefined.
Referenced by main(), and UnitTestMatrixRandomizer().
|
private |
Definition at line 143 of file nnet-randomizer.h.
Definition at line 134 of file nnet-randomizer.h.
Definition at line 135 of file nnet-randomizer.h.
|
private |
A cursor, pointing to the 'row' where the next mini-batch begins,.
Definition at line 139 of file nnet-randomizer.h.
|
private |
A cursor, pointing to the 'row' after the end of data,.
Definition at line 141 of file nnet-randomizer.h.
Definition at line 136 of file nnet-randomizer.h.