Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TMVA::Experimental::Internal::RBatchGenerator< Args > Class Template Reference

template<typename... Args>
class TMVA::Experimental::Internal::RBatchGenerator< Args >

Definition at line 50 of file RBatchGenerator.hxx.

Public Member Functions

 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)
 
 ~RBatchGenerator ()
 
void Activate ()
 Activate the loading process by starting the batchloader, and spawning the loading thread.
 
void ActivateEpoch ()
 
void ActivateTrainingEpoch ()
 
void ActivateValidationEpoch ()
 
void CreateTrainBatches ()
 Create training batches by first loading a chunk (see RChunkLoader) and split it into batches (see RBatchLoader)
 
void CreateValidationBatches ()
 Creates validation batches by first loading a chunk (see RChunkLoader), and then split it into batches (see RBatchLoader)
 
void DeActivate ()
 
void DeActivateEpoch ()
 
void DeActivateTrainingEpoch ()
 
void DeActivateValidationEpoch ()
 
RFlat2DMatrix GetTrainBatch ()
 Loads a training batch from the queue.
 
RFlat2DMatrix GetValidationBatch ()
 Loads a validation batch from the queue.
 
bool IsActive ()
 
std::size_t NumberOfTrainingBatches ()
 
std::size_t NumberOfValidationBatches ()
 
bool TrainingIsActive ()
 
std::size_t TrainRemainderRows ()
 
std::size_t ValidationRemainderRows ()
 

Private Attributes

std::vector< ROOT::RDF::RNodef_rdfs
 
std::size_t fBatchSize
 
std::size_t fBlockSize
 
std::unique_ptr< RChunkLoader< Args... > > fChunkLoader
 
std::size_t fChunkSize
 
std::vector< std::string > fCols
 
std::unique_ptr< RDatasetLoader< Args... > > fDatasetLoader
 
bool fDropRemainder
 
bool fEpochActive {false}
 
bool fIsActive {false}
 
std::mutex fIsActiveMutex
 
bool fLoadEager
 
std::unique_ptr< std::thread > fLoadingThread
 
std::size_t fMaxChunks
 
std::size_t fNumTrainingChunks
 
std::size_t fNumTrainingEntries
 
std::size_t fNumValidationChunks
 
std::size_t fNumValidationEntries
 
bool fReplacement
 
RFlat2DMatrix fSampledTrainingDataset
 
RFlat2DMatrix fSampledValidationDataset
 
float fSampleRatio
 
std::string fSampleType
 
std::size_t fSetSeed
 
bool fShuffle
 
std::unique_ptr< RFlat2DMatrixOperatorsfTensorOperators
 
RFlat2DMatrix fTrainChunkTensor
 
std::unique_ptr< RBatchLoaderfTrainingBatchLoader
 
std::size_t fTrainingChunkNum
 
RFlat2DMatrix fTrainingDataset
 
std::vector< RFlat2DMatrixfTrainingDatasets
 
bool fTrainingEpochActive {false}
 
std::unique_ptr< RSamplerfTrainingSampler
 
RFlat2DMatrix fTrainTensor
 
bool fUseWholeFile
 
std::unique_ptr< RBatchLoaderfValidationBatchLoader
 
std::size_t fValidationChunkNum
 
RFlat2DMatrix fValidationChunkTensor
 
RFlat2DMatrix fValidationDataset
 
std::vector< RFlat2DMatrixfValidationDatasets
 
bool fValidationEpochActive {false}
 
std::unique_ptr< RSamplerfValidationSampler
 
float fValidationSplit
 
RFlat2DMatrix fValidationTensor
 
std::vector< std::size_t > fVecSizes
 

#include <TMVA/BatchGenerator/RBatchGenerator.hxx>

Constructor & Destructor Documentation

◆ RBatchGenerator()

template<typename... Args>
TMVA::Experimental::Internal::RBatchGenerator< Args >::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 )
inline

Definition at line 118 of file RBatchGenerator.hxx.

◆ ~RBatchGenerator()

template<typename... Args>
TMVA::Experimental::Internal::RBatchGenerator< Args >::~RBatchGenerator ( )
inline

Definition at line 195 of file RBatchGenerator.hxx.

Member Function Documentation

◆ Activate()

template<typename... Args>
void TMVA::Experimental::Internal::RBatchGenerator< Args >::Activate ( )
inline

Activate the loading process by starting the batchloader, and spawning the loading thread.

Definition at line 216 of file RBatchGenerator.hxx.

◆ ActivateEpoch()

template<typename... Args>
void TMVA::Experimental::Internal::RBatchGenerator< Args >::ActivateEpoch ( )
inline

Definition at line 231 of file RBatchGenerator.hxx.

◆ ActivateTrainingEpoch()

template<typename... Args>
void TMVA::Experimental::Internal::RBatchGenerator< Args >::ActivateTrainingEpoch ( )
inline

Definition at line 235 of file RBatchGenerator.hxx.

◆ ActivateValidationEpoch()

template<typename... Args>
void TMVA::Experimental::Internal::RBatchGenerator< Args >::ActivateValidationEpoch ( )
inline

Definition at line 239 of file RBatchGenerator.hxx.

◆ CreateTrainBatches()

template<typename... Args>
void TMVA::Experimental::Internal::RBatchGenerator< Args >::CreateTrainBatches ( )
inline

Create training batches by first loading a chunk (see RChunkLoader) and split it into batches (see RBatchLoader)

Definition at line 245 of file RBatchGenerator.hxx.

◆ CreateValidationBatches()

template<typename... Args>
void TMVA::Experimental::Internal::RBatchGenerator< Args >::CreateValidationBatches ( )
inline

Creates validation batches by first loading a chunk (see RChunkLoader), and then split it into batches (see RBatchLoader)

Definition at line 271 of file RBatchGenerator.hxx.

◆ DeActivate()

template<typename... Args>
void TMVA::Experimental::Internal::RBatchGenerator< Args >::DeActivate ( )
inline

Definition at line 197 of file RBatchGenerator.hxx.

◆ DeActivateEpoch()

template<typename... Args>
void TMVA::Experimental::Internal::RBatchGenerator< Args >::DeActivateEpoch ( )
inline

Definition at line 233 of file RBatchGenerator.hxx.

◆ DeActivateTrainingEpoch()

template<typename... Args>
void TMVA::Experimental::Internal::RBatchGenerator< Args >::DeActivateTrainingEpoch ( )
inline

Definition at line 237 of file RBatchGenerator.hxx.

◆ DeActivateValidationEpoch()

template<typename... Args>
void TMVA::Experimental::Internal::RBatchGenerator< Args >::DeActivateValidationEpoch ( )
inline

Definition at line 241 of file RBatchGenerator.hxx.

◆ GetTrainBatch()

template<typename... Args>
RFlat2DMatrix TMVA::Experimental::Internal::RBatchGenerator< Args >::GetTrainBatch ( )
inline

Loads a training batch from the queue.

Definition at line 296 of file RBatchGenerator.hxx.

◆ GetValidationBatch()

template<typename... Args>
RFlat2DMatrix TMVA::Experimental::Internal::RBatchGenerator< Args >::GetValidationBatch ( )
inline

Loads a validation batch from the queue.

Definition at line 314 of file RBatchGenerator.hxx.

◆ IsActive()

template<typename... Args>
bool TMVA::Experimental::Internal::RBatchGenerator< Args >::IsActive ( )
inline

Definition at line 337 of file RBatchGenerator.hxx.

◆ NumberOfTrainingBatches()

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::NumberOfTrainingBatches ( )
inline

Definition at line 331 of file RBatchGenerator.hxx.

◆ NumberOfValidationBatches()

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::NumberOfValidationBatches ( )
inline

Definition at line 332 of file RBatchGenerator.hxx.

◆ TrainingIsActive()

template<typename... Args>
bool TMVA::Experimental::Internal::RBatchGenerator< Args >::TrainingIsActive ( )
inline

Definition at line 338 of file RBatchGenerator.hxx.

◆ TrainRemainderRows()

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::TrainRemainderRows ( )
inline

Definition at line 334 of file RBatchGenerator.hxx.

◆ ValidationRemainderRows()

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::ValidationRemainderRows ( )
inline

Definition at line 335 of file RBatchGenerator.hxx.

Member Data Documentation

◆ f_rdfs

template<typename... Args>
std::vector<ROOT::RDF::RNode> TMVA::Experimental::Internal::RBatchGenerator< Args >::f_rdfs
private

Definition at line 72 of file RBatchGenerator.hxx.

◆ fBatchSize

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::fBatchSize
private

Definition at line 57 of file RBatchGenerator.hxx.

◆ fBlockSize

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::fBlockSize
private

Definition at line 58 of file RBatchGenerator.hxx.

◆ fChunkLoader

template<typename... Args>
std::unique_ptr<RChunkLoader<Args...> > TMVA::Experimental::Internal::RBatchGenerator< Args >::fChunkLoader
private

Definition at line 64 of file RBatchGenerator.hxx.

◆ fChunkSize

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::fChunkSize
private

Definition at line 55 of file RBatchGenerator.hxx.

◆ fCols

template<typename... Args>
std::vector<std::string> TMVA::Experimental::Internal::RBatchGenerator< Args >::fCols
private

Definition at line 52 of file RBatchGenerator.hxx.

◆ fDatasetLoader

template<typename... Args>
std::unique_ptr<RDatasetLoader<Args...> > TMVA::Experimental::Internal::RBatchGenerator< Args >::fDatasetLoader
private

Definition at line 63 of file RBatchGenerator.hxx.

◆ fDropRemainder

template<typename... Args>
bool TMVA::Experimental::Internal::RBatchGenerator< Args >::fDropRemainder
private

Definition at line 81 of file RBatchGenerator.hxx.

◆ fEpochActive

template<typename... Args>
bool TMVA::Experimental::Internal::RBatchGenerator< Args >::fEpochActive {false}
private

Definition at line 91 of file RBatchGenerator.hxx.

◆ fIsActive

template<typename... Args>
bool TMVA::Experimental::Internal::RBatchGenerator< Args >::fIsActive {false}
private

Definition at line 88 of file RBatchGenerator.hxx.

◆ fIsActiveMutex

template<typename... Args>
std::mutex TMVA::Experimental::Internal::RBatchGenerator< Args >::fIsActiveMutex
private

Definition at line 79 of file RBatchGenerator.hxx.

◆ fLoadEager

template<typename... Args>
bool TMVA::Experimental::Internal::RBatchGenerator< Args >::fLoadEager
private

Definition at line 83 of file RBatchGenerator.hxx.

◆ fLoadingThread

template<typename... Args>
std::unique_ptr<std::thread> TMVA::Experimental::Internal::RBatchGenerator< Args >::fLoadingThread
private

Definition at line 74 of file RBatchGenerator.hxx.

◆ fMaxChunks

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::fMaxChunks
private

Definition at line 56 of file RBatchGenerator.hxx.

◆ fNumTrainingChunks

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::fNumTrainingChunks
private

Definition at line 98 of file RBatchGenerator.hxx.

◆ fNumTrainingEntries

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::fNumTrainingEntries
private

Definition at line 95 of file RBatchGenerator.hxx.

◆ fNumValidationChunks

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::fNumValidationChunks
private

Definition at line 99 of file RBatchGenerator.hxx.

◆ fNumValidationEntries

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::fNumValidationEntries
private

Definition at line 96 of file RBatchGenerator.hxx.

◆ fReplacement

template<typename... Args>
bool TMVA::Experimental::Internal::RBatchGenerator< Args >::fReplacement
private

Definition at line 86 of file RBatchGenerator.hxx.

◆ fSampledTrainingDataset

template<typename... Args>
RFlat2DMatrix TMVA::Experimental::Internal::RBatchGenerator< Args >::fSampledTrainingDataset
private

Definition at line 108 of file RBatchGenerator.hxx.

◆ fSampledValidationDataset

template<typename... Args>
RFlat2DMatrix TMVA::Experimental::Internal::RBatchGenerator< Args >::fSampledValidationDataset
private

Definition at line 109 of file RBatchGenerator.hxx.

◆ fSampleRatio

template<typename... Args>
float TMVA::Experimental::Internal::RBatchGenerator< Args >::fSampleRatio
private

Definition at line 85 of file RBatchGenerator.hxx.

◆ fSampleType

template<typename... Args>
std::string TMVA::Experimental::Internal::RBatchGenerator< Args >::fSampleType
private

Definition at line 84 of file RBatchGenerator.hxx.

◆ fSetSeed

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::fSetSeed
private

Definition at line 59 of file RBatchGenerator.hxx.

◆ fShuffle

template<typename... Args>
bool TMVA::Experimental::Internal::RBatchGenerator< Args >::fShuffle
private

Definition at line 82 of file RBatchGenerator.hxx.

◆ fTensorOperators

template<typename... Args>
std::unique_ptr<RFlat2DMatrixOperators> TMVA::Experimental::Internal::RBatchGenerator< Args >::fTensorOperators
private

Definition at line 70 of file RBatchGenerator.hxx.

◆ fTrainChunkTensor

template<typename... Args>
RFlat2DMatrix TMVA::Experimental::Internal::RBatchGenerator< Args >::fTrainChunkTensor
private

Definition at line 112 of file RBatchGenerator.hxx.

◆ fTrainingBatchLoader

template<typename... Args>
std::unique_ptr<RBatchLoader> TMVA::Experimental::Internal::RBatchGenerator< Args >::fTrainingBatchLoader
private

Definition at line 65 of file RBatchGenerator.hxx.

◆ fTrainingChunkNum

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::fTrainingChunkNum
private

Definition at line 76 of file RBatchGenerator.hxx.

◆ fTrainingDataset

template<typename... Args>
RFlat2DMatrix TMVA::Experimental::Internal::RBatchGenerator< Args >::fTrainingDataset
private

Definition at line 105 of file RBatchGenerator.hxx.

◆ fTrainingDatasets

template<typename... Args>
std::vector<RFlat2DMatrix> TMVA::Experimental::Internal::RBatchGenerator< Args >::fTrainingDatasets
private

Definition at line 102 of file RBatchGenerator.hxx.

◆ fTrainingEpochActive

template<typename... Args>
bool TMVA::Experimental::Internal::RBatchGenerator< Args >::fTrainingEpochActive {false}
private

Definition at line 92 of file RBatchGenerator.hxx.

◆ fTrainingSampler

template<typename... Args>
std::unique_ptr<RSampler> TMVA::Experimental::Internal::RBatchGenerator< Args >::fTrainingSampler
private

Definition at line 67 of file RBatchGenerator.hxx.

◆ fTrainTensor

template<typename... Args>
RFlat2DMatrix TMVA::Experimental::Internal::RBatchGenerator< Args >::fTrainTensor
private

Definition at line 111 of file RBatchGenerator.hxx.

◆ fUseWholeFile

template<typename... Args>
bool TMVA::Experimental::Internal::RBatchGenerator< Args >::fUseWholeFile
private

Definition at line 89 of file RBatchGenerator.hxx.

◆ fValidationBatchLoader

template<typename... Args>
std::unique_ptr<RBatchLoader> TMVA::Experimental::Internal::RBatchGenerator< Args >::fValidationBatchLoader
private

Definition at line 66 of file RBatchGenerator.hxx.

◆ fValidationChunkNum

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::fValidationChunkNum
private

Definition at line 77 of file RBatchGenerator.hxx.

◆ fValidationChunkTensor

template<typename... Args>
RFlat2DMatrix TMVA::Experimental::Internal::RBatchGenerator< Args >::fValidationChunkTensor
private

Definition at line 115 of file RBatchGenerator.hxx.

◆ fValidationDataset

template<typename... Args>
RFlat2DMatrix TMVA::Experimental::Internal::RBatchGenerator< Args >::fValidationDataset
private

Definition at line 106 of file RBatchGenerator.hxx.

◆ fValidationDatasets

template<typename... Args>
std::vector<RFlat2DMatrix> TMVA::Experimental::Internal::RBatchGenerator< Args >::fValidationDatasets
private

Definition at line 103 of file RBatchGenerator.hxx.

◆ fValidationEpochActive

template<typename... Args>
bool TMVA::Experimental::Internal::RBatchGenerator< Args >::fValidationEpochActive {false}
private

Definition at line 93 of file RBatchGenerator.hxx.

◆ fValidationSampler

template<typename... Args>
std::unique_ptr<RSampler> TMVA::Experimental::Internal::RBatchGenerator< Args >::fValidationSampler
private

Definition at line 68 of file RBatchGenerator.hxx.

◆ fValidationSplit

template<typename... Args>
float TMVA::Experimental::Internal::RBatchGenerator< Args >::fValidationSplit
private

Definition at line 61 of file RBatchGenerator.hxx.

◆ fValidationTensor

template<typename... Args>
RFlat2DMatrix TMVA::Experimental::Internal::RBatchGenerator< Args >::fValidationTensor
private

Definition at line 114 of file RBatchGenerator.hxx.

◆ fVecSizes

template<typename... Args>
std::vector<std::size_t> TMVA::Experimental::Internal::RBatchGenerator< Args >::fVecSizes
private

Definition at line 53 of file RBatchGenerator.hxx.

  • tmva/tmva/inc/TMVA/BatchGenerator/RBatchGenerator.hxx