28#ifndef ROOT_TMVA_MethodDL
29#define ROOT_TMVA_MethodDL
97 std::unique_ptr<MatrixImpl_t>
fYHat;
98 std::unique_ptr<DeepNetImpl_t>
fNet;
115 template <
typename Architecture_t,
typename Layer_t>
119 template <
typename Architecture_t,
typename Layer_t>
123 template <
typename Architecture_t,
typename Layer_t>
127 template <
typename Architecture_t,
typename Layer_t>
132 template <
typename Architecture_t,
typename Layer_t>
137 template <
typename Architecture_t,
typename Layer_t>
141 template <
typename Architecture_t,
typename Layer_t>
146 template <
typename Architecture_t>
151 template <
typename Architecture_t>
#define ClassDef(name, id)
The TCpu architecture class.
Generic Deep Neural Network class.
The reference architecture class.
TMatrixT< AReal > Matrix_t
Class that contains all the data information.
Virtual base Class for all MVA method.
virtual void ReadWeightsFromStream(std::istream &)=0
void SetInputWidth(size_t inputWidth)
KeyValueVector_t & GetKeyValueSettings()
size_t fBatchHeight
The height of the batch used to train the deep net.
void GetHelpMessage() const
DNN::ELossFunction fLossFunction
The loss function.
virtual const std::vector< Float_t > & GetMulticlassValues()
size_t fInputHeight
The height of the input.
TString GetErrorStrategyString() const
void SetErrorStrategyString(TString errorStrategy)
TString fLayoutString
The string defining the layout of the deep net.
std::vector< TTrainingSettings > & GetTrainingSettings()
std::unique_ptr< MatrixImpl_t > fYHat
void Train()
Methods for training the deep learning network.
size_t GetBatchHeight() const
TString GetTrainingStrategyString() const
virtual std::vector< Double_t > GetMvaValues(Long64_t firstEvt, Long64_t lastEvt, Bool_t logProgress)
Evaluate the DeepNet on a vector of input values stored in the TMVA Event class.
void ParseRnnLayer(DNN::TDeepNet< Architecture_t, Layer_t > &deepNet, std::vector< DNN::TDeepNet< Architecture_t, Layer_t > > &nets, TString layerString, TString delim)
Pases the layer string and creates the appropriate rnn layer.
TString fWeightInitializationString
The string defining the weight initialization method.
void ParseMaxPoolLayer(DNN::TDeepNet< Architecture_t, Layer_t > &deepNet, std::vector< DNN::TDeepNet< Architecture_t, Layer_t > > &nets, TString layerString, TString delim)
Pases the layer string and creates the appropriate max pool layer.
size_t fRandomSeed
The random seed used to initialize the weights and shuffling batches (default is zero)
TString fArchitectureString
The string defining the architecure: CPU or GPU.
void Init()
default initializations
MethodDL(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption)
Constructor.
void TrainDeepNet()
train of deep neural network using the defined architecture
const std::vector< TTrainingSettings > & GetTrainingSettings() const
DNN::EOutputFunction GetOutputFunction() const
void ParseLstmLayer(DNN::TDeepNet< Architecture_t, Layer_t > &deepNet, std::vector< DNN::TDeepNet< Architecture_t, Layer_t > > &nets, TString layerString, TString delim)
Pases the layer string and creates the appropriate lstm layer.
void SetInputDepth(size_t inputDepth)
Setters.
void ParseDenseLayer(DNN::TDeepNet< Architecture_t, Layer_t > &deepNet, std::vector< DNN::TDeepNet< Architecture_t, Layer_t > > &nets, TString layerString, TString delim)
Pases the layer string and creates the appropriate dense layer.
UInt_t GetNumValidationSamples()
parce the validation string and return the number of event data used for validation
TString GetBatchLayoutString() const
void SetArchitectureString(TString architectureString)
size_t fBatchWidth
The width of the batch used to train the deep net.
size_t GetInputDepth() const
virtual const std::vector< Float_t > & GetRegressionValues()
std::unique_ptr< DeepNetImpl_t > fNet
TString GetWeightInitializationString() const
TString GetInputLayoutString() const
void SetBatchHeight(size_t batchHeight)
std::vector< MatrixImpl_t > fXInput
size_t GetInputHeight() const
TString GetArchitectureString() const
void ParseBatchLayout()
Parse the input layout.
void ReadWeightsFromStream(std::istream &)
void ReadWeightsFromXML(void *wghtnode)
TString fNumValidationString
The string defining the number (or percentage) of training data used for validation.
const KeyValueVector_t & GetKeyValueSettings() const
std::vector< std::map< TString, TString > > KeyValueVector_t
DNN::EOutputFunction fOutputFunction
The output function for making the predictions.
DNN::EInitialization fWeightInitialization
The initialization method.
void SetOutputFunction(DNN::EOutputFunction outputFunction)
size_t GetBatchDepth() const
std::vector< TTrainingSettings > fTrainingSettings
The vector defining each training strategy.
size_t GetInputWidth() const
DNN::ELossFunction GetLossFunction() const
TString fBatchLayoutString
The string defining the layout of the batch.
void SetWeightInitializationString(TString weightInitializationString)
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
Check the type of analysis the deep learning network can do.
void ParseConvLayer(DNN::TDeepNet< Architecture_t, Layer_t > &deepNet, std::vector< DNN::TDeepNet< Architecture_t, Layer_t > > &nets, TString layerString, TString delim)
Pases the layer string and creates the appropriate convolutional layer.
void ParseReshapeLayer(DNN::TDeepNet< Architecture_t, Layer_t > &deepNet, std::vector< DNN::TDeepNet< Architecture_t, Layer_t > > &nets, TString layerString, TString delim)
Pases the layer string and creates the appropriate reshape layer.
TString fTrainingStrategyString
The string defining the training strategy.
void SetTrainingStrategyString(TString trainingStrategyString)
const Ranking * CreateRanking()
void SetLayoutString(TString layoutString)
const DeepNetImpl_t & GetDeepNet() const
void SetInputHeight(size_t inputHeight)
void SetBatchDepth(size_t batchDepth)
KeyValueVector_t fSettings
Map for the training strategy.
size_t fInputWidth
The width of the input.
KeyValueVector_t ParseKeyValueString(TString parseString, TString blockDelim, TString tokenDelim)
Function for parsing the training settings, provided as a string in a key-value form.
size_t fInputDepth
The depth of the input.
void SetBatchWidth(size_t batchWidth)
std::vector< Double_t > PredictDeepNet(Long64_t firstEvt, Long64_t lastEvt, size_t batchSize, Bool_t logProgress)
perform prediction of the deep neural network using batches (called by GetMvaValues)
DNN::EInitialization GetWeightInitialization() const
void SetWeightInitialization(DNN::EInitialization weightInitialization)
TString GetLayoutString() const
size_t fBatchDepth
The depth of the batch used to train the deep net.
size_t GetBatchWidth() const
void AddWeightsXMLTo(void *parent) const
typename ArchitectureImpl_t::Matrix_t MatrixImpl_t
Double_t GetMvaValue(Double_t *err=0, Double_t *errUpper=0)
virtual ~MethodDL()
Virtual Destructor.
typename ArchitectureImpl_t::Scalar_t ScalarImpl_t
void ParseInputLayout()
Parse the input layout.
bool fBuildNet
Flag to control whether to build fNet, the stored network used for the evaluation.
void CreateDeepNet(DNN::TDeepNet< Architecture_t, Layer_t > &deepNet, std::vector< DNN::TDeepNet< Architecture_t, Layer_t > > &nets)
After calling the ProcesOptions(), all of the options are parsed, so using the parsed options,...
TString fErrorStrategy
The string defining the error strategy for training.
void DeclareOptions()
The option handling methods.
TString fInputLayoutString
The string defining the layout of the input.
Ranking for variables in method (implementation)
EOptimizer
Enum representing the optimizer used for training.
EOutputFunction
Enum that represents output functions.
ERegularization
Enum representing the regularization type applied for a given layer.
ELossFunction
Enum that represents objective functions for the net, i.e.
Abstract ClassifierFactory template that handles arbitrary types.
All of the options that can be specified in the training string.
DNN::EOptimizer optimizer
DNN::ERegularization regularization
std::vector< Double_t > dropoutProbabilities