Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TMVA::Experimental::Internal::RBatchLoader Class Reference

Definition at line 41 of file RBatchLoader.hxx.

Public Member Functions

 RBatchLoader (std::size_t batchSize, std::size_t numColumns)
 
void Activate ()
 
std::unique_ptr< TMVA::Experimental::RTensor< float > > CreateBatch (TMVA::Experimental::RTensor< float > &chunkTensor, std::size_t idxs)
 Return a batch of data as a unique pointer.
 
void CreateTrainingBatches (TMVA::Experimental::RTensor< float > &chunkTensor, int lastbatch, std::size_t leftoverBatchSize, bool dropRemainder)
 Creating the training batches from a chunk and add them to the queue.
 
void CreateValidationBatches (TMVA::Experimental::RTensor< float > &chunkTensor, std::size_t lastbatch, std::size_t leftoverBatchSize, bool dropRemainder)
 Creating the validation batches from a chunk and adding them to the queue.
 
void DeActivate ()
 DeActivate the batchloader.
 
std::size_t GetNumTrainingBatchQueue ()
 
std::size_t GetNumValidationBatchQueue ()
 
TMVA::Experimental::RTensor< float > GetTrainBatch ()
 Loading the training batch from the queue.
 
TMVA::Experimental::RTensor< float > GetValidationBatch ()
 Loading the validation batch from the queue.
 

Private Attributes

std::condition_variable fBatchCondition
 
std::mutex fBatchLock
 
std::size_t fBatchSize
 
std::unique_ptr< TMVA::Experimental::RTensor< float > > fCurrentBatch
 
bool fIsActive = false
 
std::size_t fNumColumns
 
std::size_t fNumTrainingBatchQueue
 
std::size_t fNumValidationBatchQueue
 
std::unique_ptr< TMVA::Experimental::RTensor< float > > fPrimaryLeftoverTrainingBatch
 
std::unique_ptr< TMVA::Experimental::RTensor< float > > fPrimaryLeftoverValidationBatch
 
std::unique_ptr< TMVA::Experimental::RTensor< float > > fSecondaryLeftoverTrainingBatch
 
std::unique_ptr< TMVA::Experimental::RTensor< float > > fSecondaryLeftoverValidationBatch
 
std::queue< std::unique_ptr< TMVA::Experimental::RTensor< float > > > fTrainingBatchQueue
 
std::queue< std::unique_ptr< TMVA::Experimental::RTensor< float > > > fValidationBatchQueue
 

#include <TMVA/BatchGenerator/RBatchLoader.hxx>

Constructor & Destructor Documentation

◆ RBatchLoader()

TMVA::Experimental::Internal::RBatchLoader::RBatchLoader ( std::size_t batchSize,
std::size_t numColumns )
inline

Definition at line 70 of file RBatchLoader.hxx.

Member Function Documentation

◆ Activate()

void TMVA::Experimental::Internal::RBatchLoader::Activate ( )
inline

Definition at line 88 of file RBatchLoader.hxx.

◆ CreateBatch()

std::unique_ptr< TMVA::Experimental::RTensor< float > > TMVA::Experimental::Internal::RBatchLoader::CreateBatch ( TMVA::Experimental::RTensor< float > & chunkTensor,
std::size_t idxs )
inline

Return a batch of data as a unique pointer.

After the batch has been processed, it should be destroyed.

Parameters
[in]chunkTensorRTensor with the data from the chunk
[in]idxsIndex of batch in the chunk
Returns
Training batch

Definition at line 114 of file RBatchLoader.hxx.

◆ CreateTrainingBatches()

void TMVA::Experimental::Internal::RBatchLoader::CreateTrainingBatches ( TMVA::Experimental::RTensor< float > & chunkTensor,
int lastbatch,
std::size_t leftoverBatchSize,
bool dropRemainder )
inline

Creating the training batches from a chunk and add them to the queue.

Parameters
[in]chunkTensorRTensor with the data from the chunk
[in]lastbatchCheck if the batch in the chunk is the last one
[in]leftoverBatchSizeSize of the leftover batch in the training dataset
[in]dromRemainderBool to drop the remainder batch or not

Definition at line 161 of file RBatchLoader.hxx.

◆ CreateValidationBatches()

void TMVA::Experimental::Internal::RBatchLoader::CreateValidationBatches ( TMVA::Experimental::RTensor< float > & chunkTensor,
std::size_t lastbatch,
std::size_t leftoverBatchSize,
bool dropRemainder )
inline

Creating the validation batches from a chunk and adding them to the queue.

Parameters
[in]chunkTensorRTensor with the data from the chunk
[in]lastbatchCheck if the batch in the chunk is the last one
[in]leftoverBatchSizeSize of the leftover batch in the validation dataset
[in]dromRemainderBool to drop the remainder batch or not

Definition at line 266 of file RBatchLoader.hxx.

◆ DeActivate()

void TMVA::Experimental::Internal::RBatchLoader::DeActivate ( )
inline

DeActivate the batchloader.

This means that no more batches are created. Batches can still be returned if they are already loaded

Definition at line 99 of file RBatchLoader.hxx.

◆ GetNumTrainingBatchQueue()

std::size_t TMVA::Experimental::Internal::RBatchLoader::GetNumTrainingBatchQueue ( )
inline

Definition at line 346 of file RBatchLoader.hxx.

◆ GetNumValidationBatchQueue()

std::size_t TMVA::Experimental::Internal::RBatchLoader::GetNumValidationBatchQueue ( )
inline

Definition at line 347 of file RBatchLoader.hxx.

◆ GetTrainBatch()

TMVA::Experimental::RTensor< float > TMVA::Experimental::Internal::RBatchLoader::GetTrainBatch ( )
inline

Loading the training batch from the queue.

Returns
Training batch

Definition at line 126 of file RBatchLoader.hxx.

◆ GetValidationBatch()

TMVA::Experimental::RTensor< float > TMVA::Experimental::Internal::RBatchLoader::GetValidationBatch ( )
inline

Loading the validation batch from the queue.

Returns
Training batch

Definition at line 142 of file RBatchLoader.hxx.

Member Data Documentation

◆ fBatchCondition

std::condition_variable TMVA::Experimental::Internal::RBatchLoader::fBatchCondition
private

Definition at line 49 of file RBatchLoader.hxx.

◆ fBatchLock

std::mutex TMVA::Experimental::Internal::RBatchLoader::fBatchLock
private

Definition at line 48 of file RBatchLoader.hxx.

◆ fBatchSize

std::size_t TMVA::Experimental::Internal::RBatchLoader::fBatchSize
private

Definition at line 43 of file RBatchLoader.hxx.

◆ fCurrentBatch

std::unique_ptr<TMVA::Experimental::RTensor<float> > TMVA::Experimental::Internal::RBatchLoader::fCurrentBatch
private

Definition at line 60 of file RBatchLoader.hxx.

◆ fIsActive

bool TMVA::Experimental::Internal::RBatchLoader::fIsActive = false
private

Definition at line 46 of file RBatchLoader.hxx.

◆ fNumColumns

std::size_t TMVA::Experimental::Internal::RBatchLoader::fNumColumns
private

Definition at line 44 of file RBatchLoader.hxx.

◆ fNumTrainingBatchQueue

std::size_t TMVA::Experimental::Internal::RBatchLoader::fNumTrainingBatchQueue
private

Definition at line 56 of file RBatchLoader.hxx.

◆ fNumValidationBatchQueue

std::size_t TMVA::Experimental::Internal::RBatchLoader::fNumValidationBatchQueue
private

Definition at line 57 of file RBatchLoader.hxx.

◆ fPrimaryLeftoverTrainingBatch

std::unique_ptr<TMVA::Experimental::RTensor<float> > TMVA::Experimental::Internal::RBatchLoader::fPrimaryLeftoverTrainingBatch
private

Definition at line 63 of file RBatchLoader.hxx.

◆ fPrimaryLeftoverValidationBatch

std::unique_ptr<TMVA::Experimental::RTensor<float> > TMVA::Experimental::Internal::RBatchLoader::fPrimaryLeftoverValidationBatch
private

Definition at line 66 of file RBatchLoader.hxx.

◆ fSecondaryLeftoverTrainingBatch

std::unique_ptr<TMVA::Experimental::RTensor<float> > TMVA::Experimental::Internal::RBatchLoader::fSecondaryLeftoverTrainingBatch
private

Definition at line 64 of file RBatchLoader.hxx.

◆ fSecondaryLeftoverValidationBatch

std::unique_ptr<TMVA::Experimental::RTensor<float> > TMVA::Experimental::Internal::RBatchLoader::fSecondaryLeftoverValidationBatch
private

Definition at line 67 of file RBatchLoader.hxx.

◆ fTrainingBatchQueue

std::queue<std::unique_ptr<TMVA::Experimental::RTensor<float> > > TMVA::Experimental::Internal::RBatchLoader::fTrainingBatchQueue
private

Definition at line 52 of file RBatchLoader.hxx.

◆ fValidationBatchQueue

std::queue<std::unique_ptr<TMVA::Experimental::RTensor<float> > > TMVA::Experimental::Internal::RBatchLoader::fValidationBatchQueue
private

Definition at line 53 of file RBatchLoader.hxx.

Libraries for TMVA::Experimental::Internal::RBatchLoader:

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