16#ifndef ROOT_INTERNAL_ML_RBATCHGENERATOR
17#define ROOT_INTERNAL_ML_RBATCHGENERATOR
51template <
typename... Args>
73 std::vector<ROOT::RDF::RNode>
fRdfs;
118 const std::size_t batchSize,
const std::vector<std::string> &
cols,
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
In this class, the processes of loading chunks (see RChunkLoader) and creating batches from those chu...
std::unique_ptr< RSampler > fTrainingSampler
void ActivateTrainingEpoch()
Activate the training epoch by starting the batchloader.
std::size_t NumberOfTrainingBatches()
std::unique_ptr< std::thread > fLoadingThread
void CreateValidationBatches()
Creates validation batches by first loading a chunk (see RChunkLoader), and then split it into batche...
std::unique_ptr< RSampler > fValidationSampler
void DeActivateValidationEpoch()
RFlat2DMatrix fSampledValidationDataset
std::unique_ptr< RBatchLoader > fTrainingBatchLoader
RFlat2DMatrix GetTrainBatch()
Loads a training batch from the queue.
std::size_t NumberOfValidationBatches()
bool IsValidationActive()
void DeActivateTrainingEpoch()
RFlat2DMatrix fTrainingDataset
std::condition_variable fLoadingCondition
void ActivateValidationEpoch()
std::vector< ROOT::RDF::RNode > fRdfs
std::size_t fValidationChunkNum
std::vector< std::size_t > fVecSizes
void CreateTrainBatches()
Create training batches by first loading a chunk (see RChunkLoader) and split it into batches (see RB...
std::unique_ptr< RChunkLoader< Args... > > fChunkLoader
std::unique_ptr< RDatasetLoader< Args... > > fDatasetLoader
RFlat2DMatrix fValidationChunkTensor
std::unique_ptr< RFlat2DMatrixOperators > fTensorOperators
RBatchGenerator(const std::vector< ROOT::RDF::RNode > &rdfs, const std::size_t chunkSize, const std::size_t blockSize, const std::size_t batchSize, const std::vector< std::string > &cols, const std::vector< std::size_t > &vecSizes={}, const float vecPadding=0.0, const float validationSplit=0.0, const std::size_t maxChunks=0, bool shuffle=true, bool dropRemainder=true, const std::size_t setSeed=0, bool loadEager=false, std::string sampleType="", float sampleRatio=1.0, bool replacement=false)
std::size_t fNumTrainingEntries
std::size_t ValidationRemainderRows()
std::vector< RFlat2DMatrix > fValidationDatasets
void Activate()
Activate the loading process by spawning the loading thread.
std::unique_ptr< RBatchLoader > fValidationBatchLoader
bool fTrainingEpochActive
bool fValidationEpochActive
std::size_t fTrainingChunkNum
RFlat2DMatrix fValidationDataset
std::vector< std::string > fCols
std::size_t fNumValidationChunks
std::vector< RFlat2DMatrix > fTrainingDatasets
std::size_t fNumTrainingChunks
void LoadChunks()
Main loop for loading chunks and creating batches.
std::size_t TrainRemainderRows()
RFlat2DMatrix GetValidationBatch()
Loads a validation batch from the queue.
std::size_t fNumValidationEntries
RFlat2DMatrix fTrainChunkTensor
RFlat2DMatrix fSampledTrainingDataset
Building and loading the chunks from the blocks and chunks constructed in RChunkConstructor.
Load the whole dataset into memory.
void SplitDatasets()
Split the dataframes in a training and validation dataset.
Wrapper around ROOT::RVec<float> representing a 2D matrix.