Logo ROOT   master
Reference Guide
TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t > Class Template Reference

template<typename Data_t, typename Architecture_t>
class TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >

TTensorDataLoader.

Service class managing the streaming of the training data from the input data type to the accelerator device or the CPU. A TTensorDataLoader object manages a number of host and device buffer pairs that are used in a round-robin manner for the transfer of batches to the device.

Each TTensorDataLoader object has an associated batch size and a number of total samples in the dataset. One epoch is the number of buffers required to transfer the complete training set. Using the begin() and end() member functions allows the user to iterate over the batches in one epoch.

Template Parameters
Data_tThe input data type.
Architecture_tThe achitecture class of the underlying architecture.

Definition at line 83 of file TensorDataLoader.h.

Public Member Functions

 TTensorDataLoader (const Data_t &data, size_t nSamples, size_t batchSize, const Shape_t &inputLayout, const Shape_t &batchLayout, size_t nOutputFeatures, size_t nStreams=1)
 Constructor. More...
 
 TTensorDataLoader (const TTensorDataLoader &)=default
 
 TTensorDataLoader (TTensorDataLoader &&)=default
 
BatchIterator_t begin ()
 
template<>
void CopyTensorInput (TCudaHostBuffer< float > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorInput (std::vector< TMatrixT< Real_t >> &tensor, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorInput (TCudaHostBuffer< float > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorInput (std::vector< TMatrixT< Double_t >> &tensor, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorInput (std::vector< TMatrixT< Real_t >> &tensor, IndexIterator_t sampleIterator)
 
void CopyTensorInput (HostBuffer_t &buffer, IndexIterator_t begin)
 Copy input tensor into the given host buffer. More...
 
template<>
void CopyTensorInput (TCudaHostBuffer< double > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorInput (std::vector< TMatrixT< Double_t >> &tensor, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorInput (TCudaHostBuffer< double > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorInput (TCpuBuffer< Float_t > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorInput (TCudaHostBuffer< float > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorInput (TCpuBuffer< Double_t > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorInput (TCudaHostBuffer< float > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorInput (TCpuBuffer< Double_t > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorInput (TCudaHostBuffer< double > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorInput (TCudaHostBuffer< double > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorInput (TCpuBuffer< Float_t > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TCudaHostBuffer< float > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TMatrixT< Real_t > &matrix, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TCudaHostBuffer< float > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TMatrixT< Double_t > &matrix, IndexIterator_t sampleIterator)
 
void CopyTensorOutput (HostBuffer_t &buffer, IndexIterator_t begin)
 Copy output matrix into the given host buffer. More...
 
template<>
void CopyTensorOutput (TMatrixT< Real_t > &matrix, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TCudaHostBuffer< double > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TMatrixT< Double_t > &matrix, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TCudaHostBuffer< double > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TCpuBuffer< Float_t > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TCudaHostBuffer< float > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TCpuBuffer< Double_t > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TCudaHostBuffer< float > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TCpuBuffer< Double_t > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TCudaHostBuffer< double > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TCudaHostBuffer< double > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorOutput (TCpuBuffer< Float_t > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TCudaHostBuffer< float > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TMatrixT< Real_t > &matrix, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TMatrixT< Double_t > &matrix, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TCudaHostBuffer< float > &buffer, IndexIterator_t sampleIterator)
 
void CopyTensorWeights (HostBuffer_t &buffer, IndexIterator_t begin)
 Copy weight matrix into the given host buffer. More...
 
template<>
void CopyTensorWeights (TMatrixT< Real_t > &matrix, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TCudaHostBuffer< double > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TMatrixT< Double_t > &matrix, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TCudaHostBuffer< double > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TCpuBuffer< Float_t > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TCudaHostBuffer< float > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TCpuBuffer< Double_t > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TCudaHostBuffer< float > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TCpuBuffer< Double_t > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TCudaHostBuffer< double > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TCudaHostBuffer< double > &buffer, IndexIterator_t sampleIterator)
 
template<>
void CopyTensorWeights (TCpuBuffer< Float_t > &buffer, IndexIterator_t sampleIterator)
 
BatchIterator_t end ()
 
TTensorBatch< Architecture_t > GetTensorBatch ()
 Return the next batch from the training set. More...
 
TTensorDataLoaderoperator= (const TTensorDataLoader &)=default
 
TTensorDataLoaderoperator= (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< Data_t, Architecture_t >
 
using DeviceBuffer_t = typename Architecture_t::DeviceBuffer_t
 
using HostBuffer_t = typename Architecture_t::HostBuffer_t
 
using Matrix_t = typename Architecture_t::Matrix_t
 
using Shape_t = typename Architecture_t::Tensor_t::Shape_t
 
using Tensor_t = typename Architecture_t::Tensor_t
 

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 fBatchSize
 The size of a batch. More...
 
size_t fBatchWidth
 The number of columns in each matrix. More...
 
const Data_t & fData
 The data that should be loaded in the batches. More...
 
std::vector< DeviceBuffer_tfDeviceBuffers
 The device buffers used to keep the input, output and weight data. More...
 
std::vector< HostBuffer_tfHostBuffers
 The host buffers used to load the input, output and weight data. More...
 
Shape_t fInputLayout
 
size_t fNOutputFeatures
 The number of outputs from the classifier/regressor. More...
 
size_t fNSamples
 The total number of samples in the dataset. More...
 
size_t fNStreams
 Number of buffer pairs. More...
 
std::vector< size_t > fSampleIndices
 Ordering of the samples in the epoch. More...
 

#include <TMVA/DNN/TensorDataLoader.h>

Member Typedef Documentation

◆ BatchIterator_t

template<typename Data_t, typename Architecture_t>
using TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::BatchIterator_t = TTensorBatchIterator<Data_t, Architecture_t>
private

Definition at line 138 of file TensorDataLoader.h.

◆ DeviceBuffer_t

template<typename Data_t, typename Architecture_t>
using TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::DeviceBuffer_t = typename Architecture_t::DeviceBuffer_t
private

Definition at line 134 of file TensorDataLoader.h.

◆ HostBuffer_t

template<typename Data_t, typename Architecture_t>
using TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::HostBuffer_t = typename Architecture_t::HostBuffer_t
private

Definition at line 133 of file TensorDataLoader.h.

◆ Matrix_t

template<typename Data_t, typename Architecture_t>
using TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::Matrix_t = typename Architecture_t::Matrix_t
private

Definition at line 135 of file TensorDataLoader.h.

◆ Shape_t

template<typename Data_t, typename Architecture_t>
using TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::Shape_t = typename Architecture_t::Tensor_t::Shape_t
private

Definition at line 137 of file TensorDataLoader.h.

◆ Tensor_t

template<typename Data_t, typename Architecture_t>
using TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::Tensor_t = typename Architecture_t::Tensor_t
private

Definition at line 136 of file TensorDataLoader.h.

Constructor & Destructor Documentation

◆ TTensorDataLoader() [1/3]

template<typename Data_t , typename Architecture_t >
TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::TTensorDataLoader ( const Data_t &  data,
size_t  nSamples,
size_t  batchSize,
const Shape_t inputLayout,
const Shape_t batchLayout,
size_t  nOutputFeatures,
size_t  nStreams = 1 
)

Constructor.

Definition at line 207 of file TensorDataLoader.h.

◆ TTensorDataLoader() [2/3]

template<typename Data_t, typename Architecture_t>
TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::TTensorDataLoader ( const TTensorDataLoader< Data_t, Architecture_t > &  )
default

◆ TTensorDataLoader() [3/3]

template<typename Data_t, typename Architecture_t>
TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::TTensorDataLoader ( TTensorDataLoader< Data_t, Architecture_t > &&  )
default

Member Function Documentation

◆ begin()

template<typename Data_t, typename Architecture_t>
BatchIterator_t TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::begin ( )
inline

Definition at line 177 of file TensorDataLoader.h.

◆ CopyTensorInput() [1/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCudnn< float > >::CopyTensorInput ( TCudaHostBuffer< float > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 29 of file TensorDataLoader.cxx.

◆ CopyTensorInput() [2/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TReference< Real_t > >::CopyTensorInput ( std::vector< TMatrixT< Real_t >> &  tensor,
IndexIterator_t  sampleIterator 
)

Definition at line 40 of file TensorDataLoader.cxx.

◆ CopyTensorInput() [3/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCudnn< float > >::CopyTensorInput ( TCudaHostBuffer< float > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 90 of file TensorDataLoader.cxx.

◆ CopyTensorInput() [4/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TReference< Double_t > >::CopyTensorInput ( std::vector< TMatrixT< Double_t >> &  tensor,
IndexIterator_t  sampleIterator 
)

Definition at line 100 of file TensorDataLoader.cxx.

◆ CopyTensorInput() [5/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TReference< Real_t > >::CopyTensorInput ( std::vector< TMatrixT< Real_t >> &  tensor,
IndexIterator_t  sampleIterator 
)

Definition at line 160 of file TensorDataLoader.cxx.

◆ CopyTensorInput() [6/17]

template<typename Data_t, typename Architecture_t>
void TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::CopyTensorInput ( HostBuffer_t buffer,
IndexIterator_t  begin 
)

Copy input tensor into the given host buffer.

Function to be specialized by the architecture-specific backend.

◆ CopyTensorInput() [7/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCudnn< double > >::CopyTensorInput ( TCudaHostBuffer< double > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 174 of file TensorDataLoader.cxx.

◆ CopyTensorInput() [8/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TReference< Double_t > >::CopyTensorInput ( std::vector< TMatrixT< Double_t >> &  tensor,
IndexIterator_t  sampleIterator 
)

Definition at line 232 of file TensorDataLoader.cxx.

◆ CopyTensorInput() [9/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCudnn< double > >::CopyTensorInput ( TCudaHostBuffer< double > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 234 of file TensorDataLoader.cxx.

◆ CopyTensorInput() [10/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCpu< Float_t > >::CopyTensorInput ( TCpuBuffer< Float_t > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 301 of file CpuBuffer.cxx.

◆ CopyTensorInput() [11/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCuda< float > >::CopyTensorInput ( TCudaHostBuffer< float > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 374 of file CudaBuffers.cxx.

◆ CopyTensorInput() [12/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCpu< Double_t > >::CopyTensorInput ( TCpuBuffer< Double_t > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 386 of file CpuBuffer.cxx.

◆ CopyTensorInput() [13/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCuda< float > >::CopyTensorInput ( TCudaHostBuffer< float > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 434 of file CudaBuffers.cxx.

◆ CopyTensorInput() [14/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCpu< Double_t > >::CopyTensorInput ( TCpuBuffer< Double_t > &  buffer,
IndexIterator_t  sampleIterator 
)
  • re-implement specialization for Double_t

Definition at line 473 of file CpuBuffer.cxx.

◆ CopyTensorInput() [15/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCuda< Double_t > >::CopyTensorInput ( TCudaHostBuffer< double > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 519 of file CudaBuffers.cxx.

◆ CopyTensorInput() [16/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCuda< Double_t > >::CopyTensorInput ( TCudaHostBuffer< double > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 580 of file CudaBuffers.cxx.

◆ CopyTensorInput() [17/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCpu< Float_t > >::CopyTensorInput ( TCpuBuffer< Float_t > &  buffer,
IndexIterator_t  sampleIterator 
)
  • re-implement specialization for Float_t

Definition at line 583 of file CpuBuffer.cxx.

◆ CopyTensorOutput() [1/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCudnn< float > >::CopyTensorOutput ( TCudaHostBuffer< float > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 59 of file TensorDataLoader.cxx.

◆ CopyTensorOutput() [2/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TReference< Real_t > >::CopyTensorOutput ( TMatrixT< Real_t > &  matrix,
IndexIterator_t  sampleIterator 
)

Definition at line 68 of file TensorDataLoader.cxx.

◆ CopyTensorOutput() [3/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCudnn< float > >::CopyTensorOutput ( TCudaHostBuffer< float > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 128 of file TensorDataLoader.cxx.

◆ CopyTensorOutput() [4/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TReference< Double_t > >::CopyTensorOutput ( TMatrixT< Double_t > &  matrix,
IndexIterator_t  sampleIterator 
)

Definition at line 128 of file TensorDataLoader.cxx.

◆ CopyTensorOutput() [5/17]

template<typename Data_t, typename Architecture_t>
void TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::CopyTensorOutput ( HostBuffer_t buffer,
IndexIterator_t  begin 
)

Copy output matrix into the given host buffer.

Function to be specialized by the architecture-spcific backend.

◆ CopyTensorOutput() [6/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TReference< Real_t > >::CopyTensorOutput ( TMatrixT< Real_t > &  matrix,
IndexIterator_t  sampleIterator 
)

Definition at line 191 of file TensorDataLoader.cxx.

◆ CopyTensorOutput() [7/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCudnn< double > >::CopyTensorOutput ( TCudaHostBuffer< double > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 204 of file TensorDataLoader.cxx.

◆ CopyTensorOutput() [8/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TReference< Double_t > >::CopyTensorOutput ( TMatrixT< Double_t > &  matrix,
IndexIterator_t  sampleIterator 
)

Definition at line 263 of file TensorDataLoader.cxx.

◆ CopyTensorOutput() [9/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCudnn< double > >::CopyTensorOutput ( TCudaHostBuffer< double > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 271 of file TensorDataLoader.cxx.

◆ CopyTensorOutput() [10/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCpu< Float_t > >::CopyTensorOutput ( TCpuBuffer< Float_t > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 331 of file CpuBuffer.cxx.

◆ CopyTensorOutput() [11/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCuda< float > >::CopyTensorOutput ( TCudaHostBuffer< float > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 404 of file CudaBuffers.cxx.

◆ CopyTensorOutput() [12/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCpu< Double_t > >::CopyTensorOutput ( TCpuBuffer< Double_t > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 416 of file CpuBuffer.cxx.

◆ CopyTensorOutput() [13/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCuda< float > >::CopyTensorOutput ( TCudaHostBuffer< float > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 472 of file CudaBuffers.cxx.

◆ CopyTensorOutput() [14/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCpu< Double_t > >::CopyTensorOutput ( TCpuBuffer< Double_t > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 511 of file CpuBuffer.cxx.

◆ CopyTensorOutput() [15/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCuda< Double_t > >::CopyTensorOutput ( TCudaHostBuffer< double > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 549 of file CudaBuffers.cxx.

◆ CopyTensorOutput() [16/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCuda< Double_t > >::CopyTensorOutput ( TCudaHostBuffer< double > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 619 of file CudaBuffers.cxx.

◆ CopyTensorOutput() [17/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCpu< Float_t > >::CopyTensorOutput ( TCpuBuffer< Float_t > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 621 of file CpuBuffer.cxx.

◆ CopyTensorWeights() [1/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCudnn< float > >::CopyTensorWeights ( TCudaHostBuffer< float > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 77 of file TensorDataLoader.cxx.

◆ CopyTensorWeights() [2/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TReference< Real_t > >::CopyTensorWeights ( TMatrixT< Real_t > &  matrix,
IndexIterator_t  sampleIterator 
)

Definition at line 86 of file TensorDataLoader.cxx.

◆ CopyTensorWeights() [3/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TReference< Double_t > >::CopyTensorWeights ( TMatrixT< Double_t > &  matrix,
IndexIterator_t  sampleIterator 
)

Definition at line 146 of file TensorDataLoader.cxx.

◆ CopyTensorWeights() [4/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCudnn< float > >::CopyTensorWeights ( TCudaHostBuffer< float > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 162 of file TensorDataLoader.cxx.

◆ CopyTensorWeights() [5/17]

template<typename Data_t, typename Architecture_t>
void TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::CopyTensorWeights ( HostBuffer_t buffer,
IndexIterator_t  begin 
)

Copy weight matrix into the given host buffer.

Function to be specialized by the architecture-spcific backend.

◆ CopyTensorWeights() [6/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TReference< Real_t > >::CopyTensorWeights ( TMatrixT< Real_t > &  matrix,
IndexIterator_t  sampleIterator 
)

Definition at line 220 of file TensorDataLoader.cxx.

◆ CopyTensorWeights() [7/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCudnn< double > >::CopyTensorWeights ( TCudaHostBuffer< double > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 222 of file TensorDataLoader.cxx.

◆ CopyTensorWeights() [8/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TReference< Double_t > >::CopyTensorWeights ( TMatrixT< Double_t > &  matrix,
IndexIterator_t  sampleIterator 
)

Definition at line 292 of file TensorDataLoader.cxx.

◆ CopyTensorWeights() [9/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCudnn< double > >::CopyTensorWeights ( TCudaHostBuffer< double > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 306 of file TensorDataLoader.cxx.

◆ CopyTensorWeights() [10/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCpu< Float_t > >::CopyTensorWeights ( TCpuBuffer< Float_t > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 349 of file CpuBuffer.cxx.

◆ CopyTensorWeights() [11/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCuda< float > >::CopyTensorWeights ( TCudaHostBuffer< float > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 422 of file CudaBuffers.cxx.

◆ CopyTensorWeights() [12/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCpu< Double_t > >::CopyTensorWeights ( TCpuBuffer< Double_t > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 434 of file CpuBuffer.cxx.

◆ CopyTensorWeights() [13/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCuda< float > >::CopyTensorWeights ( TCudaHostBuffer< float > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 507 of file CudaBuffers.cxx.

◆ CopyTensorWeights() [14/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCpu< Double_t > >::CopyTensorWeights ( TCpuBuffer< Double_t > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 546 of file CpuBuffer.cxx.

◆ CopyTensorWeights() [15/17]

template<>
void TMVA::DNN::TTensorDataLoader< TensorInput, TCuda< Double_t > >::CopyTensorWeights ( TCudaHostBuffer< double > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 567 of file CudaBuffers.cxx.

◆ CopyTensorWeights() [16/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCuda< Double_t > >::CopyTensorWeights ( TCudaHostBuffer< double > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 654 of file CudaBuffers.cxx.

◆ CopyTensorWeights() [17/17]

template<>
void TMVA::DNN::TTensorDataLoader< TMVAInput_t, TCpu< Float_t > >::CopyTensorWeights ( TCpuBuffer< Float_t > &  buffer,
IndexIterator_t  sampleIterator 
)

Definition at line 656 of file CpuBuffer.cxx.

◆ end()

template<typename Data_t, typename Architecture_t>
BatchIterator_t TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::end ( )
inline

Definition at line 178 of file TensorDataLoader.h.

◆ GetTensorBatch()

template<typename Data_t , typename Architecture_t >
TTensorBatch< Architecture_t > TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::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 231 of file TensorDataLoader.h.

◆ operator=() [1/2]

template<typename Data_t, typename Architecture_t>
TTensorDataLoader& TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::operator= ( const TTensorDataLoader< Data_t, Architecture_t > &  )
default

◆ operator=() [2/2]

template<typename Data_t, typename Architecture_t>
TTensorDataLoader& TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::operator= ( TTensorDataLoader< Data_t, Architecture_t > &&  )
default

◆ Shuffle()

template<typename Data_t , typename Architecture_t >
template<typename RNG >
void TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::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 283 of file TensorDataLoader.h.

Member Data Documentation

◆ fBatchDepth

template<typename Data_t, typename Architecture_t>
size_t TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::fBatchDepth
private

The number of matrices in the tensor.

Definition at line 144 of file TensorDataLoader.h.

◆ fBatchHeight

template<typename Data_t, typename Architecture_t>
size_t TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::fBatchHeight
private

The number od rows in each matrix.

Definition at line 145 of file TensorDataLoader.h.

◆ fBatchIndex

template<typename Data_t, typename Architecture_t>
size_t TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::fBatchIndex
private

The index of the batch when there are multiple batches in parallel.

Definition at line 148 of file TensorDataLoader.h.

◆ fBatchSize

template<typename Data_t, typename Architecture_t>
size_t TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::fBatchSize
private

The size of a batch.

Definition at line 142 of file TensorDataLoader.h.

◆ fBatchWidth

template<typename Data_t, typename Architecture_t>
size_t TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::fBatchWidth
private

The number of columns in each matrix.

Definition at line 146 of file TensorDataLoader.h.

◆ fData

template<typename Data_t, typename Architecture_t>
const Data_t& TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::fData
private

The data that should be loaded in the batches.

Definition at line 140 of file TensorDataLoader.h.

◆ fDeviceBuffers

template<typename Data_t, typename Architecture_t>
std::vector<DeviceBuffer_t> TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::fDeviceBuffers
private

The device buffers used to keep the input, output and weight data.

Definition at line 152 of file TensorDataLoader.h.

◆ fHostBuffers

template<typename Data_t, typename Architecture_t>
std::vector<HostBuffer_t> TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::fHostBuffers
private

The host buffers used to load the input, output and weight data.

Definition at line 153 of file TensorDataLoader.h.

◆ fInputLayout

template<typename Data_t, typename Architecture_t>
Shape_t TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::fInputLayout
private

Definition at line 143 of file TensorDataLoader.h.

◆ fNOutputFeatures

template<typename Data_t, typename Architecture_t>
size_t TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::fNOutputFeatures
private

The number of outputs from the classifier/regressor.

Definition at line 147 of file TensorDataLoader.h.

◆ fNSamples

template<typename Data_t, typename Architecture_t>
size_t TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::fNSamples
private

The total number of samples in the dataset.

Definition at line 141 of file TensorDataLoader.h.

◆ fNStreams

template<typename Data_t, typename Architecture_t>
size_t TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::fNStreams
private

Number of buffer pairs.

Definition at line 151 of file TensorDataLoader.h.

◆ fSampleIndices

template<typename Data_t, typename Architecture_t>
std::vector<size_t> TMVA::DNN::TTensorDataLoader< Data_t, Architecture_t >::fSampleIndices
private

Ordering of the samples in the epoch.

Definition at line 155 of file TensorDataLoader.h.


The documentation for this class was generated from the following file: