34 #ifndef TMVA_DNN_ARCHITECTURES_REFERENCE_TENSORDATALOADER 35 #define TMVA_DNN_ARCHITECTURES_REFERENCE_TENSORDATALOADER 43 template <
typename AReal>
46 template <
typename AData,
typename AReal>
69 TTensorDataLoader(
const AData &
data,
size_t nSamples,
size_t batchSize,
size_t batchDepth,
size_t batchHeight,
70 size_t batchWidth,
size_t nOutputFeatures,
size_t nStreams = 1);
93 template<
typename RNG>
105 template <
typename AData,
typename AReal>
107 size_t batchDepth,
size_t batchHeight,
size_t batchWidth,
108 size_t nOutputFeatures,
size_t )
111 outputMatrix(batchSize, nOutputFeatures), weightMatrix(batchSize, 1),
fSampleIndices()
114 inputTensor.reserve(batchDepth);
115 for (
size_t i = 0; i < batchDepth; i++) {
116 inputTensor.emplace_back(batchHeight, batchWidth);
125 template <
typename AData,
typename AReal>
126 template <
typename RNG>
132 template <
typename AData,
typename AReal>
TMatrixT< AReal > weightMatrix
The matrix used to keep the batch weights.
std::vector< size_t > fSampleIndices
Ordering of the samples in the epoch.
void CopyTensorInput(HostBuffer_t &buffer, IndexIterator_t begin)
Copy input tensor into the given host buffer.
The reference architecture class.
TTensorBatch< Architecture_t > GetTensorBatch()
Return the next batch from the training set.
size_t fBatchHeight
The number od rows in each matrix.
typename std::vector< size_t >::iterator IndexIterator_t
size_t fBatchIndex
The index of the batch when there are multiple batches in parallel.
void CopyTensorWeights(HostBuffer_t &buffer, IndexIterator_t begin)
Copy weight matrix into the given host buffer.
TTensorDataLoader(const Data_t &data, size_t nSamples, size_t batchSize, size_t batchDepth, size_t batchHeight, size_t batchWidth, size_t nOutputFeatures, size_t nStreams=1)
Constructor.
size_t fBatchWidth
The number of columns in each matrix.
void CopyTensorOutput(HostBuffer_t &buffer, IndexIterator_t begin)
Copy output matrix into the given host buffer.
size_t fBatchDepth
The number of matrices in the tensor.
size_t fBatchSize
The size of a batch.
size_t fBatchIndex
The index of the batch when there are multiple batches in parallel.
size_t fNOutputFeatures
The number of outputs from the classifier/regressor.
TMatrixT< AReal > outputMatrix
The matrix used to keep the output.
const AData & fData
The data that should be loaded in the batches.
void Shuffle(RNG &rng)
Shuffle the order of the samples in the batch.
TTensorDataLoader & operator=(const TTensorDataLoader &)=default
TTensorBatchIterator< Data_t, Architecture_t > BatchIterator_t
Abstract ClassifierFactory template that handles arbitrary types.
size_t fNSamples
The total number of samples in the dataset.
size_t fNSamples
The total number of samples in the dataset.
size_t fBatchWidth
The number of columns in each matrix.
size_t fBatchSize
The size of a batch.
size_t fBatchDepth
The number of matrices in the tensor.
const Data_t & fData
The data that should be loaded in the batches.
size_t fBatchHeight
The number od rows in each matrix.
size_t fNOutputFeatures
The number of outputs from the classifier/regressor.
std::vector< TMatrixT< AReal > > inputTensor
The 3D tensor used to keep the input data.
std::vector< size_t > fSampleIndices
Ordering of the samples in the epoch.