1#ifndef TMVA_BATCHGENERATOR
2#define TMVA_BATCHGENERATOR
20namespace Experimental {
23template <
typename... Args>
45 std::unique_ptr<TMVA::Experimental::Internal::RBatchLoader>
fBatchLoader;
68 const std::size_t batchSize,
const std::vector<std::string> &
cols,
const std::string &
filters =
"",
100 std::make_unique<TMVA::Experimental::RTensor<float>>(std::vector<std::size_t>{
fChunkSize,
fNumColumns});
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
const_iterator begin() const
const_iterator end() const
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
void CreateBatches(std::size_t currentChunk, std::size_t processedEvents)
Create batches for the current_chunk.
std::unique_ptr< std::thread > fLoadingThread
const TMVA::Experimental::RTensor< float > & GetTrainBatch()
Returns the next batch of training data if available.
void Activate()
Activate the loading process by starting the batchloader, and spawning the loading thread.
const TMVA::Experimental::RTensor< float > & GetValidationBatch()
Returns the next batch of validation data if available.
std::vector< std::vector< std::size_t > > fTrainingIdxs
std::vector< std::string > fCols
void DeActivate()
De-activate the loading process by deactivating the batchgenerator and joining the loading thread.
void createIdxs(std::size_t processedEvents)
plit the events of the current chunk into validation and training events
std::unique_ptr< TMVA::Experimental::Internal::RBatchLoader > fBatchLoader
std::vector< std::size_t > fVecSizes
std::vector< std::vector< std::size_t > > fValidationIdxs
TMVA::RandomGenerator< TRandom3 > fRng
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)
std::unique_ptr< TMVA::Experimental::RTensor< float > > fCurrentBatch
std::unique_ptr< TMVA::Experimental::Internal::RChunkLoader< Args... > > fChunkLoader
std::unique_ptr< TMVA::Experimental::RTensor< float > > fChunkTensor
RTensor is a container with contiguous memory and shape information.
A TTree represents a columnar dataset.
virtual Long64_t GetEntries() const
void EnableThreadSafety()
Enable support for multi-threading within the ROOT code in particular, enables the global mutex to ma...
create variable transformations