16#ifndef ROOT_INTERNAL_ML_RBATCHLOADER
17#define ROOT_INTERNAL_ML_RBATCHLOADER
19#include <condition_variable>
44 std::condition_variable &
fCV;
70 std::condition_variable &
sharedCV,
const std::vector<std::size_t> &
vecSizes = {},
Building and loading the batches from loaded chunks in RChunkLoader.
RFlat2DMatrix GetBatch()
Loading the batch from the queue.
std::size_t fNumFullBatches
std::size_t GetNumEntries()
std::size_t GetNumBatches()
std::unique_ptr< RFlat2DMatrix > fSecondaryLeftoverBatch
std::queue< std::unique_ptr< RFlat2DMatrix > > fBatchQueue
void Reset()
Reset the batchloader state.
std::size_t fLeftoverBatchSize
void Activate()
Activate the batchloader. This means that batches can be created and loaded.
void MarkProducerDone()
Signal that the producer has finished pushing all batches for this epoch.
std::size_t GetNumRemainderRows()
void CreateBatches(RFlat2DMatrix &chunkTensor, bool isLastBatch)
Creating the batches from a chunk and add them to the queue.
void DeActivate()
DeActivate the batchloader.
std::unique_ptr< RFlat2DMatrix > fPrimaryLeftoverBatch
std::vector< std::size_t > fVecSizes
std::vector< std::string > fCols
std::unique_ptr< RFlat2DMatrix > fCurrentBatch
std::size_t GetNumBatchQueue()
RBatchLoader(std::size_t batchSize, const std::vector< std::string > &cols, std::mutex &sharedMutex, std::condition_variable &sharedCV, const std::vector< std::size_t > &vecSizes={}, std::size_t numEntries=0, bool dropRemainder=false)
std::unique_ptr< RFlat2DMatrix > CreateBatch(RFlat2DMatrix &chunkTensor, std::size_t idxs)
Return a batch of data as a unique pointer.
std::condition_variable & fCV
Wrapper around ROOT::RVec<float> representing a 2D matrix.