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 24 of file RBatchGenerator.hxx.

Public Member Functions

 RBatchGenerator (const std::string &treeName, const std::string &fileName, const std::size_t chunkSize, const std::size_t batchSize, const std::vector< std::string > &cols, const std::string &filters="", const std::vector< std::size_t > &vecSizes={}, const float vecPadding=0.0, const float validationSplit=0.0, const std::size_t maxChunks=0, const std::size_t numColumns=0, bool shuffle=true)
 
 ~RBatchGenerator ()
 
void Activate ()
 Activate the loading process by starting the batchloader, and spawning the loading thread.
 
void CreateBatches (std::size_t currentChunk, std::size_t processedEvents)
 Create batches for the current_chunk.
 
void createIdxs (std::size_t processedEvents)
 plit the events of the current chunk into validation and training events
 
void DeActivate ()
 De-activate the loading process by deactivating the batchgenerator and joining the loading thread.
 
const TMVA::Experimental::RTensor< float > & GetTrainBatch ()
 Returns the next batch of training data if available.
 
const TMVA::Experimental::RTensor< float > & GetValidationBatch ()
 Returns the next batch of validation data if available.
 
bool HasTrainData ()
 
bool HasValidationData ()
 
bool IsActive ()
 
void LoadChunks ()
 
void StartValidation ()
 

Private Attributes

std::unique_ptr< TMVA::Experimental::Internal::RBatchLoaderfBatchLoader
 
std::size_t fBatchSize
 
std::unique_ptr< TMVA::Experimental::Internal::RChunkLoader< Args... > > fChunkLoader
 
std::size_t fChunkSize
 
std::unique_ptr< TMVA::Experimental::RTensor< float > > fChunkTensor
 
std::vector< std::string > fCols
 
std::unique_ptr< TMVA::Experimental::RTensor< float > > fCurrentBatch
 
std::size_t fCurrentRow = 0
 
std::string fFileName
 
std::string fFilters
 
bool fIsActive = false
 
std::mutex fIsActiveLock
 
std::unique_ptr< std::thread > fLoadingThread
 
std::size_t fMaxBatches
 
std::size_t fMaxChunks
 
std::size_t fNumColumns
 
std::size_t fNumEntries
 
TMVA::RandomGenerator< TRandom3fRng = TMVA::RandomGenerator<TRandom3>(0)
 
bool fShuffle = true
 
std::vector< std::vector< std::size_t > > fTrainingIdxs
 
std::string fTreeName
 
bool fUseWholeFile = true
 
std::vector< std::vector< std::size_t > > fValidationIdxs
 
float fValidationSplit
 
float fVecPadding
 
std::vector< std::size_t > fVecSizes
 

#include <TMVA/RBatchGenerator.hxx>

Constructor & Destructor Documentation

◆ RBatchGenerator()

template<typename... Args>
TMVA::Experimental::Internal::RBatchGenerator< Args >::RBatchGenerator ( const std::string &  treeName,
const std::string &  fileName,
const std::size_t  chunkSize,
const std::size_t  batchSize,
const std::vector< std::string > &  cols,
const std::string &  filters = "",
const std::vector< std::size_t > &  vecSizes = {},
const float  vecPadding = 0.0,
const float  validationSplit = 0.0,
const std::size_t  maxChunks = 0,
const std::size_t  numColumns = 0,
bool  shuffle = true 
)
inline

Definition at line 67 of file RBatchGenerator.hxx.

◆ ~RBatchGenerator()

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

Definition at line 103 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 125 of file RBatchGenerator.hxx.

◆ CreateBatches()

template<typename... Args>
void TMVA::Experimental::Internal::RBatchGenerator< Args >::CreateBatches ( std::size_t  currentChunk,
std::size_t  processedEvents 
)
inline

Create batches for the current_chunk.

Parameters
currentChunk
processedEvents

Definition at line 192 of file RBatchGenerator.hxx.

◆ createIdxs()

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

plit the events of the current chunk into validation and training events

Parameters
processedEvents

Definition at line 208 of file RBatchGenerator.hxx.

◆ DeActivate()

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

De-activate the loading process by deactivating the batchgenerator and joining the loading thread.

Definition at line 107 of file RBatchGenerator.hxx.

◆ GetTrainBatch()

template<typename... Args>
const TMVA::Experimental::RTensor< float > & TMVA::Experimental::Internal::RBatchGenerator< Args >::GetTrainBatch ( )
inline

Returns the next batch of training data if available.

Returns empty RTensor otherwise.

Returns

Definition at line 143 of file RBatchGenerator.hxx.

◆ GetValidationBatch()

template<typename... Args>
const TMVA::Experimental::RTensor< float > & TMVA::Experimental::Internal::RBatchGenerator< Args >::GetValidationBatch ( )
inline

Returns the next batch of validation data if available.

Returns empty RTensor otherwise.

Returns

Definition at line 152 of file RBatchGenerator.hxx.

◆ HasTrainData()

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

Definition at line 158 of file RBatchGenerator.hxx.

◆ HasValidationData()

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

Definition at line 160 of file RBatchGenerator.hxx.

◆ IsActive()

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

Definition at line 230 of file RBatchGenerator.hxx.

◆ LoadChunks()

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

Definition at line 162 of file RBatchGenerator.hxx.

◆ StartValidation()

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

Definition at line 229 of file RBatchGenerator.hxx.

Member Data Documentation

◆ fBatchLoader

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

Definition at line 45 of file RBatchGenerator.hxx.

◆ fBatchSize

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

Definition at line 36 of file RBatchGenerator.hxx.

◆ fChunkLoader

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

Definition at line 44 of file RBatchGenerator.hxx.

◆ fChunkSize

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

Definition at line 34 of file RBatchGenerator.hxx.

◆ fChunkTensor

template<typename... Args>
std::unique_ptr<TMVA::Experimental::RTensor<float> > TMVA::Experimental::Internal::RBatchGenerator< Args >::fChunkTensor
private

Definition at line 51 of file RBatchGenerator.hxx.

◆ fCols

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

Definition at line 31 of file RBatchGenerator.hxx.

◆ fCurrentBatch

template<typename... Args>
std::unique_ptr<TMVA::Experimental::RTensor<float> > TMVA::Experimental::Internal::RBatchGenerator< Args >::fCurrentBatch
private

Definition at line 52 of file RBatchGenerator.hxx.

◆ fCurrentRow

template<typename... Args>
std::size_t TMVA::Experimental::Internal::RBatchGenerator< Args >::fCurrentRow = 0
private

Definition at line 40 of file RBatchGenerator.hxx.

◆ fFileName

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

Definition at line 28 of file RBatchGenerator.hxx.

◆ fFilters

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

Definition at line 32 of file RBatchGenerator.hxx.

◆ fIsActive

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

Definition at line 61 of file RBatchGenerator.hxx.

◆ fIsActiveLock

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

Definition at line 58 of file RBatchGenerator.hxx.

◆ fLoadingThread

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

Definition at line 47 of file RBatchGenerator.hxx.

◆ fMaxBatches

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

Definition at line 37 of file RBatchGenerator.hxx.

◆ fMaxChunks

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

Definition at line 35 of file RBatchGenerator.hxx.

◆ fNumColumns

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

Definition at line 38 of file RBatchGenerator.hxx.

◆ fNumEntries

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

Definition at line 39 of file RBatchGenerator.hxx.

◆ fRng

Definition at line 26 of file RBatchGenerator.hxx.

◆ fShuffle

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

Definition at line 60 of file RBatchGenerator.hxx.

◆ fTrainingIdxs

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

Definition at line 54 of file RBatchGenerator.hxx.

◆ fTreeName

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

Definition at line 29 of file RBatchGenerator.hxx.

◆ fUseWholeFile

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

Definition at line 49 of file RBatchGenerator.hxx.

◆ fValidationIdxs

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

Definition at line 55 of file RBatchGenerator.hxx.

◆ fValidationSplit

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

Definition at line 42 of file RBatchGenerator.hxx.

◆ fVecPadding

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

Definition at line 64 of file RBatchGenerator.hxx.

◆ fVecSizes

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

Definition at line 63 of file RBatchGenerator.hxx.

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