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, const std::vector< std::string > &cols, const std::vector< std::size_t > &vecSizes={}, std::size_t numEntries=0, bool dropRemainder=false)
 
void Activate ()
 
std::unique_ptr< RFlat2DMatrixCreateBatch (RFlat2DMatrix &chunTensor, std::size_t idxs)
 Return a batch of data as a unique pointer.
 
void CreateBatches (RFlat2DMatrix &chunkTensor, std::size_t lastbatch)
 Creating the batches from a chunk and add them to the queue.
 
void DeActivate ()
 DeActivate the batchloader.
 
RFlat2DMatrix GetBatch ()
 Loading the batch from the queue.
 
std::size_t GetNumBatches ()
 
std::size_t GetNumBatchQueue ()
 
std::size_t GetNumEntries ()
 
std::size_t GetNumRemainderRows ()
 

Private Attributes

std::condition_variable fBatchCondition
 
std::mutex fBatchLock
 
std::queue< std::unique_ptr< RFlat2DMatrix > > fBatchQueue
 
std::size_t fBatchSize
 
std::vector< std::string > fCols
 
std::unique_ptr< RFlat2DMatrixfCurrentBatch
 
bool fDropRemainder
 
bool fIsActive = false
 
std::size_t fLeftoverBatchSize
 
std::size_t fNumBatches
 
std::size_t fNumColumns
 
std::size_t fNumEntries
 
std::size_t fNumFullBatches
 
std::size_t fNumLeftoverBatches
 
std::unique_ptr< RFlat2DMatrixfPrimaryLeftoverBatch
 
std::unique_ptr< RFlat2DMatrixfSecondaryLeftoverBatch
 
std::size_t fSumVecSizes
 
std::vector< std::size_t > fVecSizes
 

#include <TMVA/BatchGenerator/RBatchLoader.hxx>

Constructor & Destructor Documentation

◆ RBatchLoader()

TMVA::Experimental::Internal::RBatchLoader::RBatchLoader ( std::size_t batchSize,
const std::vector< std::string > & cols,
const std::vector< std::size_t > & vecSizes = {},
std::size_t numEntries = 0,
bool dropRemainder = false )
inline

Definition at line 73 of file RBatchLoader.hxx.

Member Function Documentation

◆ Activate()

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

Definition at line 108 of file RBatchLoader.hxx.

◆ CreateBatch()

std::unique_ptr< RFlat2DMatrix > TMVA::Experimental::Internal::RBatchLoader::CreateBatch ( RFlat2DMatrix & chunTensor,
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]chunkTensorTensor with the data from the chunk
[in]idxsIndex of batch in the chunk
Returns
Batch

Definition at line 133 of file RBatchLoader.hxx.

◆ CreateBatches()

void TMVA::Experimental::Internal::RBatchLoader::CreateBatches ( RFlat2DMatrix & chunkTensor,
std::size_t lastbatch )
inline

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

Parameters
[in]chunkTensorTensor with the data from the chunk
[in]lastbatchCheck if the batch in the chunk is the last one

Definition at line 162 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 119 of file RBatchLoader.hxx.

◆ GetBatch()

RFlat2DMatrix TMVA::Experimental::Internal::RBatchLoader::GetBatch ( )
inline

Loading the batch from the queue.

Returns
Batch

Definition at line 144 of file RBatchLoader.hxx.

◆ GetNumBatches()

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

Definition at line 253 of file RBatchLoader.hxx.

◆ GetNumBatchQueue()

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

Definition at line 256 of file RBatchLoader.hxx.

◆ GetNumEntries()

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

Definition at line 254 of file RBatchLoader.hxx.

◆ GetNumRemainderRows()

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

Definition at line 255 of file RBatchLoader.hxx.

Member Data Documentation

◆ fBatchCondition

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

Definition at line 60 of file RBatchLoader.hxx.

◆ fBatchLock

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

Definition at line 59 of file RBatchLoader.hxx.

◆ fBatchQueue

std::queue<std::unique_ptr<RFlat2DMatrix> > TMVA::Experimental::Internal::RBatchLoader::fBatchQueue
private

Definition at line 63 of file RBatchLoader.hxx.

◆ fBatchSize

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

Definition at line 43 of file RBatchLoader.hxx.

◆ fCols

std::vector<std::string> TMVA::Experimental::Internal::RBatchLoader::fCols
private

Definition at line 45 of file RBatchLoader.hxx.

◆ fCurrentBatch

std::unique_ptr<RFlat2DMatrix> TMVA::Experimental::Internal::RBatchLoader::fCurrentBatch
private

Definition at line 66 of file RBatchLoader.hxx.

◆ fDropRemainder

bool TMVA::Experimental::Internal::RBatchLoader::fDropRemainder
private

Definition at line 50 of file RBatchLoader.hxx.

◆ fIsActive

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

Definition at line 57 of file RBatchLoader.hxx.

◆ fLeftoverBatchSize

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

Definition at line 55 of file RBatchLoader.hxx.

◆ fNumBatches

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

Definition at line 54 of file RBatchLoader.hxx.

◆ fNumColumns

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

Definition at line 48 of file RBatchLoader.hxx.

◆ fNumEntries

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

Definition at line 49 of file RBatchLoader.hxx.

◆ fNumFullBatches

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

Definition at line 52 of file RBatchLoader.hxx.

◆ fNumLeftoverBatches

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

Definition at line 53 of file RBatchLoader.hxx.

◆ fPrimaryLeftoverBatch

std::unique_ptr<RFlat2DMatrix> TMVA::Experimental::Internal::RBatchLoader::fPrimaryLeftoverBatch
private

Definition at line 69 of file RBatchLoader.hxx.

◆ fSecondaryLeftoverBatch

std::unique_ptr<RFlat2DMatrix> TMVA::Experimental::Internal::RBatchLoader::fSecondaryLeftoverBatch
private

Definition at line 70 of file RBatchLoader.hxx.

◆ fSumVecSizes

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

Definition at line 47 of file RBatchLoader.hxx.

◆ fVecSizes

std::vector<std::size_t> TMVA::Experimental::Internal::RBatchLoader::fVecSizes
private

Definition at line 46 of file RBatchLoader.hxx.

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

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