16#ifndef ROOT_INTERNAL_ML_RBATCHLOADER
17#define ROOT_INTERNAL_ML_RBATCHLOADER
19#include <condition_variable>
44 std::condition_variable &
fCV;
68 RBatchLoader(std::size_t batchSize,
const std::vector<std::string> &cols, std::mutex &sharedMutex,
69 std::condition_variable &sharedCV,
const std::vector<std::size_t> &vecSizes = {},
70 std::size_t numEntries = 0,
bool dropRemainder =
false);
77 std::unique_ptr<RFlat2DMatrix>
81 std::size_t beginRow, std::size_t endRow,
bool isLastBatch);
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::size_t GetBatchSize()
std::queue< std::unique_ptr< RFlat2DMatrix > > fBatchQueue
std::unique_ptr< RFlat2DMatrix > CreateBatch(const RFlat2DMatrix &chunkTensor, const std::vector< std::size_t > &permutation, std::size_t firstRow)
Return a batch of data as a unique pointer.
void CreateBatches(const RFlat2DMatrix &chunkTensor, const std::vector< std::size_t > &permutation, std::size_t beginRow, std::size_t endRow, bool isLastBatch)
Creating the batches from a chunk and add them to the queue.
void RecalculateBatchCounts(std::size_t numEntries)
Recalculate batch counts from the given number of entries.
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 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::condition_variable & fCV
Wrapper around ROOT::RVec<float> representing a 2D matrix.