Definition at line 47 of file TensorDataLoader.h.
Public Member Functions | |
TTensorDataLoader (const AData &data, size_t nSamples, size_t batchDepth, size_t batchHeight, size_t batchWidth, size_t nOutputFeatures, std::vector< size_t > inputShape, size_t nStreams=1) | |
Constructor. More... | |
TTensorDataLoader (const TTensorDataLoader &)=default | |
TTensorDataLoader (TTensorDataLoader &&)=default | |
BatchIterator_t | begin () |
void | CopyTensorInput (std::vector< TMatrixT< AReal > > &tensor, IndexIterator_t sampleIterator) |
Copy input tensor into the given host buffer. More... | |
void | CopyTensorOutput (TMatrixT< AReal > &matrix, IndexIterator_t sampleIterator) |
Copy output matrix into the given host buffer. More... | |
void | CopyTensorWeights (TMatrixT< AReal > &matrix, IndexIterator_t sampleIterator) |
Copy weight matrix into the given host buffer. More... | |
BatchIterator_t | end () |
TTensorBatch< TReference< AReal > > | GetTensorBatch () |
Return the next batch from the training set. More... | |
TTensorDataLoader & | operator= (const TTensorDataLoader &)=default |
TTensorDataLoader & | operator= (TTensorDataLoader &&)=default |
template<typename RNG > | |
void | Shuffle (RNG &rng) |
Shuffle the order of the samples in the batch. More... | |
Private Types | |
using | BatchIterator_t = TTensorBatchIterator< AData, TReference< AReal > > |
Private Attributes | |
size_t | fBatchDepth |
The number of matrices in the tensor. More... | |
size_t | fBatchHeight |
The number od rows in each matrix. More... | |
size_t | fBatchIndex |
The index of the batch when there are multiple batches in parallel. More... | |
size_t | fBatchWidth |
The number of columns in each matrix. More... | |
const AData & | fData |
The data that should be loaded in the batches. More... | |
std::vector< size_t > | fInputShape |
Defines the batch depth, no. of channels and spatial dimensions of an input tensor. More... | |
size_t | fNOutputFeatures |
The number of outputs from the classifier/regressor. More... | |
size_t | fNSamples |
The total number of samples in the dataset. More... | |
std::vector< size_t > | fSampleIndices |
Ordering of the samples in the epoch. More... | |
std::vector< TMatrixT< AReal > > | inputTensor |
The 3D tensor used to keep the input data. More... | |
TMatrixT< AReal > | outputMatrix |
The matrix used to keep the output. More... | |
TMatrixT< AReal > | weightMatrix |
The matrix used to keep the batch weights. More... | |
#include <TMVA/DNN/Architectures/Reference/TensorDataLoader.h>
|
private |
Definition at line 49 of file TensorDataLoader.h.
TMVA::DNN::TTensorDataLoader< AData, TReference< AReal > >::TTensorDataLoader | ( | const AData & | data, |
size_t | nSamples, | ||
size_t | batchDepth, | ||
size_t | batchHeight, | ||
size_t | batchWidth, | ||
size_t | nOutputFeatures, | ||
std::vector< size_t > | inputShape, | ||
size_t | nStreams = 1 |
||
) |
Constructor.
Definition at line 109 of file TensorDataLoader.h.
|
default |
|
default |
|
inline |
Definition at line 90 of file TensorDataLoader.h.
void TMVA::DNN::TTensorDataLoader< AData, TReference< AReal > >::CopyTensorInput | ( | std::vector< TMatrixT< AReal > > & | tensor, |
IndexIterator_t | sampleIterator | ||
) |
Copy input tensor into the given host buffer.
Function to be specialized by the architecture-specific backend.
void TMVA::DNN::TTensorDataLoader< AData, TReference< AReal > >::CopyTensorOutput | ( | TMatrixT< AReal > & | matrix, |
IndexIterator_t | sampleIterator | ||
) |
Copy output matrix into the given host buffer.
Function to be specialized by the architecture-spcific backend.
void TMVA::DNN::TTensorDataLoader< AData, TReference< AReal > >::CopyTensorWeights | ( | TMatrixT< AReal > & | matrix, |
IndexIterator_t | sampleIterator | ||
) |
Copy weight matrix into the given host buffer.
Function to be specialized by the architecture-spcific backend.
|
inline |
Definition at line 91 of file TensorDataLoader.h.
auto TMVA::DNN::TTensorDataLoader< AData, TReference< AReal > >::GetTensorBatch |
Return the next batch from the training set.
The TTensorDataLoader object keeps an internal counter that cycles over the batches in the training set.
Definition at line 136 of file TensorDataLoader.h.
|
default |
|
default |
void TMVA::DNN::TTensorDataLoader< AData, TReference< AReal > >::Shuffle | ( | RNG & | rng | ) |
Shuffle the order of the samples in the batch.
The shuffling is indirect, i.e. only the indices are shuffled. No input data is moved by this routine.
Definition at line 130 of file TensorDataLoader.h.
|
private |
The number of matrices in the tensor.
Definition at line 55 of file TensorDataLoader.h.
|
private |
The number od rows in each matrix.
Definition at line 56 of file TensorDataLoader.h.
|
private |
The index of the batch when there are multiple batches in parallel.
Definition at line 59 of file TensorDataLoader.h.
|
private |
The number of columns in each matrix.
Definition at line 57 of file TensorDataLoader.h.
|
private |
The data that should be loaded in the batches.
Definition at line 51 of file TensorDataLoader.h.
|
private |
Defines the batch depth, no. of channels and spatial dimensions of an input tensor.
Definition at line 61 of file TensorDataLoader.h.
|
private |
The number of outputs from the classifier/regressor.
Definition at line 58 of file TensorDataLoader.h.
|
private |
The total number of samples in the dataset.
Definition at line 53 of file TensorDataLoader.h.
|
private |
Ordering of the samples in the epoch.
Definition at line 67 of file TensorDataLoader.h.
|
private |
The 3D tensor used to keep the input data.
Definition at line 63 of file TensorDataLoader.h.
|
private |
The matrix used to keep the output.
Definition at line 64 of file TensorDataLoader.h.
|
private |
The matrix used to keep the batch weights.
Definition at line 65 of file TensorDataLoader.h.