15#ifndef TMVA_RBATCHGENERATOR
16#define TMVA_RBATCHGENERATOR
33namespace Experimental {
45template <
typename... Args>
111 const std::size_t batchSize,
const std::vector<std::string> &
cols,
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
unsigned long long ULong64_t
Portable unsigned long integer 8 bytes.
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
The public interface to the RDataFrame federation of classes.
RResultPtr< ULong64_t > Count()
Return the number of entries processed (lazy action).
RResultPtr< COLL > Take(std::string_view column="")
Return a collection of values of a column (lazy action, returns a std::vector by default).
Smart pointer for the return type of actions.
const_iterator begin() const
const_iterator end() const
Building and loading the chunks from the blocks and chunks constructed in RChunkConstructor.
bool fValidationEpochActive
std::size_t fNumLeftoverTrainingBatches
void ActivateTrainingEpoch()
std::size_t ValidationRemainderRows()
std::size_t TrainRemainderRows()
RBatchGenerator(ROOT::RDF::RNode &rdf, 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)
std::size_t fValidationChunkNum
std::size_t fNumValidationChunks
std::size_t fNumTrainingEntries
std::unique_ptr< std::thread > fLoadingThread
std::size_t NumberOfTrainingBatches()
std::size_t fNumLeftoverValidationBatches
std::size_t fNumValidationEntries
std::size_t fTrainingChunkNum
void Activate()
Activate the loading process by starting the batchloader, and spawning the loading thread.
std::size_t NumberOfValidationBatches()
TMVA::Experimental::RTensor< float > fValidationTensor
void CreateValidationBatches()
Creates validation batches by first loading a chunk (see RChunkLoader), and then split it into batche...
std::size_t fNumTrainingBatches
std::size_t fNumChunkCols
std::size_t fNumFullValidationBatches
std::vector< std::string > fCols
void CreateTrainBatches()
Create training batches by first loading a chunk (see RChunkLoader) and split it into batches (see RB...
void DeActivateValidationEpoch()
std::size_t fNumFullTrainingBatches
TMVA::Experimental::RTensor< float > fTrainTensor
TMVA::Experimental::RTensor< float > GetValidationBatch()
Loads a validation batch from the queue
void DeActivateTrainingEpoch()
std::unique_ptr< RChunkLoader< Args... > > fChunkLoader
std::size_t fNumTrainingChunks
std::size_t fNumValidationBatches
std::unique_ptr< RBatchLoader > fBatchLoader
std::mutex fIsActiveMutex
TMVA::Experimental::RTensor< float > GetTrainBatch()
Loads a training batch from the queue.
ROOT::RDF::RResultPtr< std::vector< ULong64_t > > fEntries
TMVA::Experimental::RTensor< float > fValidationChunkTensor
bool fTrainingEpochActive
std::size_t fLeftoverTrainingBatchSize
std::size_t fLeftoverValidationBatchSize
TMVA::Experimental::RTensor< float > fTrainChunkTensor
void ActivateValidationEpoch()
RTensor is a container with contiguous memory and shape information.
void ChangeBeginAndEndEntries(const RNode &node, Long64_t begin, Long64_t end)
create variable transformations