Logo ROOT  
Reference Guide
MethodDL.h
Go to the documentation of this file.
1 // @(#)root/tmva/tmva/dnn:$Id$
2 // Author: Vladimir Ilievski, Saurav Shekhar
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : MethodDL *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Deep Neural Network Method *
12  * *
13  * Authors (alphabetical): *
14  * Vladimir Ilievski <ilievski.vladimir@live.com> - CERN, Switzerland *
15  * Saurav Shekhar <sauravshekhar01@gmail.com> - ETH Zurich, Switzerland *
16  * *
17  * Copyright (c) 2005-2015: *
18  * CERN, Switzerland *
19  * U. of Victoria, Canada *
20  * MPI-K Heidelberg, Germany *
21  * U. of Bonn, Germany *
22  * *
23  * Redistribution and use in source and binary forms, with or without *
24  * modification, are permitted according to the terms listed in LICENSE *
25  * (http://tmva.sourceforge.net/LICENSE) *
26  **********************************************************************************/
27 
28 #ifndef ROOT_TMVA_MethodDL
29 #define ROOT_TMVA_MethodDL
30 
31 //////////////////////////////////////////////////////////////////////////
32 // //
33 // MethodDL //
34 // //
35 // Method class for all Deep Learning Networks //
36 // //
37 //////////////////////////////////////////////////////////////////////////
38 
39 #include "TString.h"
40 
41 #include "TMVA/MethodBase.h"
42 #include "TMVA/Types.h"
43 
45 
46 //#ifdef R__HAS_TMVACPU
48 //#endif
49 
50 #if 0
51 #ifdef R__HAS_TMVAGPU
53 #ifdef R__HAS_CUDNN
55 #endif
56 #endif
57 #endif
58 
59 #include "TMVA/DNN/Functions.h"
60 #include "TMVA/DNN/DeepNet.h"
61 
62 #include <vector>
63 #include <map>
64 
65 #ifdef R__HAS_TMVAGPU
66 //#define USE_GPU_INFERENCE
67 #endif
68 
69 namespace TMVA {
70 
71 /*! All of the options that can be specified in the training string */
73  size_t batchSize;
74  size_t testInterval;
76  size_t maxEpochs;
83  std::vector<Double_t> dropoutProbabilities;
84  std::map<TString,double> optimizerParams;
86 };
87 
88 
89 class MethodDL : public MethodBase {
90 
91 private:
92  // Key-Value vector type, contining the values for the training options
93  using KeyValueVector_t = std::vector<std::map<TString, TString>>;
94 
95 // #ifdef R__HAS_TMVAGPU
96 // #ifdef R__HAS_CUDNN
97 // using ArchitectureImpl_t = TMVA::DNN::TCudnn<Float_t>;
98 // #else
99 // using ArchitectureImpl_t = TMVA::DNN::TCuda<Float_t>;
100 // #endif
101 // #else
102 // do not use arch GPU for evaluation. It is too slow for batch size=1
104 // #endif
105 
111 
112  /*! The option handling methods */
113  void DeclareOptions();
114  void ProcessOptions();
115 
116  void Init();
117 
118  // Function to parse the layout of the input
119  void ParseInputLayout();
120  void ParseBatchLayout();
121 
122  /*! After calling the ProcesOptions(), all of the options are parsed,
123  * so using the parsed options, and given the architecture and the
124  * type of the layers, we build the Deep Network passed as
125  * a reference in the function. */
126  template <typename Architecture_t, typename Layer_t>
128  std::vector<DNN::TDeepNet<Architecture_t, Layer_t>> &nets);
129 
130  template <typename Architecture_t, typename Layer_t>
132  std::vector<DNN::TDeepNet<Architecture_t, Layer_t>> &nets, TString layerString, TString delim);
133 
134  template <typename Architecture_t, typename Layer_t>
136  std::vector<DNN::TDeepNet<Architecture_t, Layer_t>> &nets, TString layerString, TString delim);
137 
138  template <typename Architecture_t, typename Layer_t>
140  std::vector<DNN::TDeepNet<Architecture_t, Layer_t>> &nets, TString layerString,
141  TString delim);
142 
143  template <typename Architecture_t, typename Layer_t>
145  std::vector<DNN::TDeepNet<Architecture_t, Layer_t>> &nets, TString layerString,
146  TString delim);
147 
148  template <typename Architecture_t, typename Layer_t>
150  std::vector<DNN::TDeepNet<Architecture_t, Layer_t>> &nets, TString layerString,
151  TString delim);
152 
154  template <typename Architecture_t, typename Layer_t>
156  std::vector<DNN::TDeepNet<Architecture_t, Layer_t>> &nets, TString layerString, TString delim);
157 
158 
159  /// train of deep neural network using the defined architecture
160  template <typename Architecture_t>
161  void TrainDeepNet();
162 
163  /// perform prediction of the deep neural network
164  /// using batches (called by GetMvaValues)
165  template <typename Architecture_t>
166  std::vector<Double_t> PredictDeepNet(Long64_t firstEvt, Long64_t lastEvt, size_t batchSize, Bool_t logProgress);
167 
168  /// parce the validation string and return the number of event data used for validation
170 
171  // cudnn implementation needs this format
172  /** Contains the batch size (no. of images in the batch), input depth (no. channels)
173  * and furhter input dimensios of the data (image height, width ...)*/
174  std::vector<size_t> fInputShape;
175 
176  // The size of the batch, i.e. the number of images that are contained in the batch, is either set to be the depth
177  // or the height of the batch
178  size_t fBatchDepth; ///< The depth of the batch used to train the deep net.
179  size_t fBatchHeight; ///< The height of the batch used to train the deep net.
180  size_t fBatchWidth; ///< The width of the batch used to train the deep net.
181 
182  size_t fRandomSeed; ///<The random seed used to initialize the weights and shuffling batches (default is zero)
183 
184  DNN::EInitialization fWeightInitialization; ///< The initialization method
185  DNN::EOutputFunction fOutputFunction; ///< The output function for making the predictions
186  DNN::ELossFunction fLossFunction; ///< The loss function
187 
188  TString fInputLayoutString; ///< The string defining the layout of the input
189  TString fBatchLayoutString; ///< The string defining the layout of the batch
190  TString fLayoutString; ///< The string defining the layout of the deep net
191  TString fErrorStrategy; ///< The string defining the error strategy for training
192  TString fTrainingStrategyString; ///< The string defining the training strategy
193  TString fWeightInitializationString; ///< The string defining the weight initialization method
194  TString fArchitectureString; ///< The string defining the architecure: CPU or GPU
195  TString fNumValidationString; ///< The string defining the number (or percentage) of training data used for validation
196  bool fResume;
197  bool fBuildNet; ///< Flag to control whether to build fNet, the stored network used for the evaluation
198 
199  KeyValueVector_t fSettings; ///< Map for the training strategy
200  std::vector<TTrainingSettings> fTrainingSettings; ///< The vector defining each training strategy
201 
202  TensorImpl_t fXInput; // input tensor used to evaluate fNet
203  HostBufferImpl_t fXInputBuffer; // input hist buffer corresponding to X (needed for GPU implementation)
204  std::unique_ptr<MatrixImpl_t> fYHat; // output prediction matrix of fNet
205  std::unique_ptr<DeepNetImpl_t> fNet;
206 
207 
208  ClassDef(MethodDL, 0);
209 
210 protected:
211  // provide a help message
212  void GetHelpMessage() const;
213 
214  virtual std::vector<Double_t> GetMvaValues(Long64_t firstEvt, Long64_t lastEvt, Bool_t logProgress);
215 
216 
217 public:
218  /*! Constructor */
219  MethodDL(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption);
220 
221  /*! Constructor */
222  MethodDL(DataSetInfo &theData, const TString &theWeightFile);
223 
224  /*! Virtual Destructor */
225  virtual ~MethodDL();
226 
227  /*! Function for parsing the training settings, provided as a string
228  * in a key-value form. */
229  KeyValueVector_t ParseKeyValueString(TString parseString, TString blockDelim, TString tokenDelim);
230 
231  /*! Check the type of analysis the deep learning network can do */
232  Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets);
233 
234  /*! Methods for training the deep learning network */
235  void Train();
236 
237  Double_t GetMvaValue(Double_t *err = 0, Double_t *errUpper = 0);
238  virtual const std::vector<Float_t>& GetRegressionValues();
239  virtual const std::vector<Float_t>& GetMulticlassValues();
240 
241  /*! Methods for writing and reading weights */
243  void AddWeightsXMLTo(void *parent) const;
244  void ReadWeightsFromXML(void *wghtnode);
245  void ReadWeightsFromStream(std::istream &);
246 
247  /* Create ranking */
248  const Ranking *CreateRanking();
249 
250  /* Getters */
251  size_t GetInputDepth() const { return fInputShape[1]; } //< no. of channels for an image
252  size_t GetInputHeight() const { return fInputShape[2]; }
253  size_t GetInputWidth() const { return fInputShape[3]; }
254  size_t GetInputDim() const { return fInputShape.size() - 2; }
255  std::vector<size_t> GetInputShape() const { return fInputShape; }
256 
257  size_t GetBatchSize() const { return fInputShape[0]; }
258  size_t GetBatchDepth() const { return fBatchDepth; }
259  size_t GetBatchHeight() const { return fBatchHeight; }
260  size_t GetBatchWidth() const { return fBatchWidth; }
261 
262  const DeepNetImpl_t & GetDeepNet() const { return *fNet; }
263 
267 
275 
276  const std::vector<TTrainingSettings> &GetTrainingSettings() const { return fTrainingSettings; }
277  std::vector<TTrainingSettings> &GetTrainingSettings() { return fTrainingSettings; }
278  const KeyValueVector_t &GetKeyValueSettings() const { return fSettings; }
280 
281  /** Setters */
282  void SetInputDepth (int inputDepth) { fInputShape[1] = inputDepth; }
283  void SetInputHeight(int inputHeight) { fInputShape[2] = inputHeight; }
284  void SetInputWidth (int inputWidth) { fInputShape[3] = inputWidth; }
285  void SetInputShape (std::vector<size_t> inputShape) { fInputShape = std::move(inputShape); }
286 
287  void SetBatchSize (size_t batchSize) { fInputShape[0] = batchSize; }
288  void SetBatchDepth (size_t batchDepth) { fBatchDepth = batchDepth; }
289  void SetBatchHeight(size_t batchHeight) { fBatchHeight = batchHeight; }
290  void SetBatchWidth (size_t batchWidth) { fBatchWidth = batchWidth; }
291 
293  {
294  fWeightInitialization = weightInitialization;
295  }
296  void SetOutputFunction (DNN::EOutputFunction outputFunction) { fOutputFunction = outputFunction; }
297  void SetErrorStrategyString (TString errorStrategy) { fErrorStrategy = errorStrategy; }
298  void SetTrainingStrategyString (TString trainingStrategyString) { fTrainingStrategyString = trainingStrategyString; }
299  void SetWeightInitializationString(TString weightInitializationString)
300  {
301  fWeightInitializationString = weightInitializationString;
302  }
303  void SetArchitectureString (TString architectureString) { fArchitectureString = architectureString; }
304  void SetLayoutString (TString layoutString) { fLayoutString = layoutString; }
305 };
306 
307 } // namespace TMVA
308 
309 #endif
TMVA::MethodDL::Train
void Train()
Methods for training the deep learning network.
Definition: MethodDL.cxx:1661
Cpu.h
TMVA::MethodDL::fWeightInitializationString
TString fWeightInitializationString
The string defining the weight initialization method.
Definition: MethodDL.h:193
TMVA::MethodDL::GetInputShape
std::vector< size_t > GetInputShape() const
Definition: MethodDL.h:255
TMVA::DNN::TCpu::Scalar_t
AReal Scalar_t
Definition: Cpu.h:69
TMVA::MethodDL::TrainDeepNet
void TrainDeepNet()
train of deep neural network using the defined architecture
Definition: MethodDL.cxx:1166
TMVA::MethodDL::GetKeyValueSettings
const KeyValueVector_t & GetKeyValueSettings() const
Definition: MethodDL.h:278
TMVA::MethodDL::fBuildNet
bool fBuildNet
Flag to control whether to build fNet, the stored network used for the evaluation.
Definition: MethodDL.h:197
TMVA::MethodDL::GetKeyValueSettings
KeyValueVector_t & GetKeyValueSettings()
Definition: MethodDL.h:279
TMVA::MethodDL::GetDeepNet
const DeepNetImpl_t & GetDeepNet() const
Definition: MethodDL.h:262
TMVA::MethodDL::ParseMaxPoolLayer
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.
Definition: MethodDL.cxx:770
TMVA::MethodDL::fLayoutString
TString fLayoutString
The string defining the layout of the deep net.
Definition: MethodDL.h:190
TMVA::MethodDL::fYHat
std::unique_ptr< MatrixImpl_t > fYHat
Definition: MethodDL.h:204
TMVA::MethodDL::fOutputFunction
DNN::EOutputFunction fOutputFunction
The output function for making the predictions.
Definition: MethodDL.h:185
TMVA::TTrainingSettings::optimizerName
TString optimizerName
Definition: MethodDL.h:79
TMVA::DNN::EOptimizer
EOptimizer
Enum representing the optimizer used for training.
Definition: Functions.h:82
TMVA::MethodDL::GetLayoutString
TString GetLayoutString() const
Definition: MethodDL.h:270
TMVA::MethodDL::AddWeightsXMLTo
void AddWeightsXMLTo(void *parent) const
Definition: MethodDL.cxx:2060
TMVA::MethodDL::SetArchitectureString
void SetArchitectureString(TString architectureString)
Definition: MethodDL.h:303
TMVA::MethodDL::GetHelpMessage
void GetHelpMessage() const
Definition: MethodDL.cxx:2351
TMVA::MethodDL::GetArchitectureString
TString GetArchitectureString() const
Definition: MethodDL.h:274
TMVA::MethodDL::kLayerRNN
@ kLayerRNN
Definition: MethodDL.h:153
TMVA::DNN::EOutputFunction
EOutputFunction
Enum that represents output functions.
Definition: Functions.h:46
TMVA::DNN::TCpu
The TCpu architecture class.
Definition: Cpu.h:65
TMVA::MethodBase::ReadWeightsFromStream
virtual void ReadWeightsFromStream(std::istream &)=0
TMVA::MethodDL::HostBufferImpl_t
typename ArchitectureImpl_t::HostBuffer_t HostBufferImpl_t
Definition: MethodDL.h:110
TMVA::DNN::ERegularization
ERegularization
Enum representing the regularization type applied for a given layer.
Definition: Functions.h:65
TMVA::MethodDL::GetMulticlassValues
virtual const std::vector< Float_t > & GetMulticlassValues()
Definition: MethodDL.cxx:1997
TMVA::Ranking
Ranking for variables in method (implementation)
Definition: Ranking.h:48
TMVA::MethodDL::GetBatchSize
size_t GetBatchSize() const
Definition: MethodDL.h:257
TMVA::TTrainingSettings::maxEpochs
size_t maxEpochs
Definition: MethodDL.h:76
TMVA::MethodDL::CreateDeepNet
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,...
Definition: MethodDL.cxx:529
Long64_t
long long Long64_t
Definition: RtypesCore.h:80
TMVA::MethodDL::GetInputHeight
size_t GetInputHeight() const
Definition: MethodDL.h:252
TMVA::MethodDL::DeclareOptions
void DeclareOptions()
The option handling methods.
Definition: MethodDL.cxx:167
TMVA::MethodDL::CreateRanking
const Ranking * CreateRanking()
Definition: MethodDL.cxx:2344
TMVA::MethodDL::ParseReshapeLayer
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.
Definition: MethodDL.cxx:831
TMVA::MethodDL::fNumValidationString
TString fNumValidationString
The string defining the number (or percentage) of training data used for validation.
Definition: MethodDL.h:195
TMVA::MethodDL::GetTrainingSettings
std::vector< TTrainingSettings > & GetTrainingSettings()
Definition: MethodDL.h:277
TMVA::MethodDL::kLayerGRU
@ kLayerGRU
Definition: MethodDL.h:153
TMVA::MethodDL::GetBatchWidth
size_t GetBatchWidth() const
Definition: MethodDL.h:260
TMVA::MethodDL::PredictDeepNet
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)
Definition: MethodDL.cxx:1829
TMVA::MethodDL::~MethodDL
virtual ~MethodDL()
Virtual Destructor.
Definition: MethodDL.cxx:1047
TMVA::TTrainingSettings::learningRate
Double_t learningRate
Definition: MethodDL.h:80
TMVA::MethodDL::ParseRecurrentLayer
void ParseRecurrentLayer(ERecurrentLayerType type, 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.
Definition: MethodDL.cxx:933
TMVA::MethodDL::fInputShape
std::vector< size_t > fInputShape
Contains the batch size (no.
Definition: MethodDL.h:174
TMVA::TTrainingSettings::multithreading
bool multithreading
Definition: MethodDL.h:85
TMVA::MethodDL::SetInputHeight
void SetInputHeight(int inputHeight)
Definition: MethodDL.h:283
TMVA::MethodDL::GetWeightInitializationString
TString GetWeightInitializationString() const
Definition: MethodDL.h:273
TMVA::MethodDL::SetLayoutString
void SetLayoutString(TString layoutString)
Definition: MethodDL.h:304
TMVA::MethodDL::SetBatchHeight
void SetBatchHeight(size_t batchHeight)
Definition: MethodDL.h:289
MethodBase.h
TMVA::MethodDL::fWeightInitialization
DNN::EInitialization fWeightInitialization
The initialization method.
Definition: MethodDL.h:184
TMVA::MethodDL::fSettings
KeyValueVector_t fSettings
Map for the training strategy.
Definition: MethodDL.h:199
TMVA::MethodDL::fTrainingSettings
std::vector< TTrainingSettings > fTrainingSettings
The vector defining each training strategy.
Definition: MethodDL.h:200
TMVA::MethodDL::Init
void Init()
default initializations
Definition: MethodDL.cxx:432
TMVA::MethodDL::SetInputDepth
void SetInputDepth(int inputDepth)
Setters.
Definition: MethodDL.h:282
TString
Basic string class.
Definition: TString.h:136
TMVA::MethodDL::GetInputLayoutString
TString GetInputLayoutString() const
Definition: MethodDL.h:268
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TMVA::MethodDL::GetMvaValue
Double_t GetMvaValue(Double_t *err=0, Double_t *errUpper=0)
Definition: MethodDL.cxx:1707
TMVA::MethodDL::HasAnalysisType
Bool_t HasAnalysisType(Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets)
Check the type of analysis the deep learning network can do.
Definition: MethodDL.cxx:1093
TMVA::MethodDL::SetWeightInitializationString
void SetWeightInitializationString(TString weightInitializationString)
Definition: MethodDL.h:299
TMVA::MethodDL::fXInputBuffer
HostBufferImpl_t fXInputBuffer
Definition: MethodDL.h:203
TMVA::MethodDL::MatrixImpl_t
typename ArchitectureImpl_t::Matrix_t MatrixImpl_t
Definition: MethodDL.h:107
TString.h
bool
TMVA::MethodDL::SetBatchWidth
void SetBatchWidth(size_t batchWidth)
Definition: MethodDL.h:290
TMVA::MethodDL::fBatchLayoutString
TString fBatchLayoutString
The string defining the layout of the batch.
Definition: MethodDL.h:189
Cuda.h
TMVA::TTrainingSettings::weightDecay
Double_t weightDecay
Definition: MethodDL.h:82
TMVA::MethodDL::GetLossFunction
DNN::ELossFunction GetLossFunction() const
Definition: MethodDL.h:266
TMVA::MethodDL::fTrainingStrategyString
TString fTrainingStrategyString
The string defining the training strategy.
Definition: MethodDL.h:192
TMVA::TTrainingSettings::batchSize
size_t batchSize
Definition: MethodDL.h:73
TMVA::MethodDL::ParseKeyValueString
KeyValueVector_t ParseKeyValueString(TString parseString, TString blockDelim, TString tokenDelim)
Function for parsing the training settings, provided as a string in a key-value form.
Definition: MethodDL.cxx:1054
TMVA::MethodDL::ParseInputLayout
void ParseInputLayout()
Parse the input layout.
Definition: MethodDL.cxx:439
TMVA::DataSetInfo
Class that contains all the data information.
Definition: DataSetInfo.h:62
TMVA::DNN::TCpu::Tensor_t
TCpuTensor< AReal > Tensor_t
Definition: Cpu.h:70
TMVA::MethodDL::SetWeightInitialization
void SetWeightInitialization(DNN::EInitialization weightInitialization)
Definition: MethodDL.h:292
TMVA::MethodDL::ERecurrentLayerType
ERecurrentLayerType
Definition: MethodDL.h:153
TMVA::MethodDL::SetTrainingStrategyString
void SetTrainingStrategyString(TString trainingStrategyString)
Definition: MethodDL.h:298
TMVA::MethodDL::SetOutputFunction
void SetOutputFunction(DNN::EOutputFunction outputFunction)
Definition: MethodDL.h:296
TMVA::MethodDL::fInputLayoutString
TString fInputLayoutString
The string defining the layout of the input.
Definition: MethodDL.h:188
TMVA::Types::EAnalysisType
EAnalysisType
Definition: Types.h:128
TMVA::MethodDL::SetErrorStrategyString
void SetErrorStrategyString(TString errorStrategy)
Definition: MethodDL.h:297
TMVA::MethodDL::GetTrainingSettings
const std::vector< TTrainingSettings > & GetTrainingSettings() const
Definition: MethodDL.h:276
TMVA::MethodDL::ParseBatchLayout
void ParseBatchLayout()
Parse the input layout.
Definition: MethodDL.cxx:482
TMVA::MethodDL::SetBatchDepth
void SetBatchDepth(size_t batchDepth)
Definition: MethodDL.h:288
TMVA::MethodDL::SetInputWidth
void SetInputWidth(int inputWidth)
Definition: MethodDL.h:284
TMVA::TTrainingSettings::regularization
DNN::ERegularization regularization
Definition: MethodDL.h:77
TMVA::MethodDL::fLossFunction
DNN::ELossFunction fLossFunction
The loss function.
Definition: MethodDL.h:186
TMVA::MethodDL::GetRegressionValues
virtual const std::vector< Float_t > & GetRegressionValues()
Definition: MethodDL.cxx:1959
TMVA::TTrainingSettings::optimizerParams
std::map< TString, double > optimizerParams
Definition: MethodDL.h:84
TMVA::MethodDL::ReadWeightsFromStream
virtual void ReadWeightsFromStream(std::istream &)=0
Methods for writing and reading weights.
TMVA::MethodDL::ProcessOptions
void ProcessOptions()
Definition: MethodDL.cxx:219
TMVA::MethodBase
Virtual base Class for all MVA method.
Definition: MethodBase.h:111
TCudnn.h
TMVA::MethodDL::fNet
std::unique_ptr< DeepNetImpl_t > fNet
Definition: MethodDL.h:205
Types.h
TMVA::MethodDL::ParseDenseLayer
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.
Definition: MethodDL.cxx:583
TMVA::TTrainingSettings::optimizer
DNN::EOptimizer optimizer
Definition: MethodDL.h:78
TMVA::MethodDL::KeyValueVector_t
std::vector< std::map< TString, TString > > KeyValueVector_t
Definition: MethodDL.h:93
TMVA::MethodDL::fResume
bool fResume
Definition: MethodDL.h:196
unsigned int
TMVA::DNN::EInitialization
EInitialization
Definition: Functions.h:72
TMVA::DNN::TCpu::HostBuffer_t
TCpuBuffer< AReal > HostBuffer_t
Definition: Cpu.h:72
TMVA::MethodDL::GetBatchLayoutString
TString GetBatchLayoutString() const
Definition: MethodDL.h:269
TMVA::TTrainingSettings::convergenceSteps
size_t convergenceSteps
Definition: MethodDL.h:75
TMVA::MethodDL::fErrorStrategy
TString fErrorStrategy
The string defining the error strategy for training.
Definition: MethodDL.h:191
TMVA::DNN::ELossFunction
ELossFunction
Enum that represents objective functions for the net, i.e.
Definition: Functions.h:57
Functions.h
TMVA::MethodDL::kLayerLSTM
@ kLayerLSTM
Definition: MethodDL.h:153
Double_t
double Double_t
Definition: RtypesCore.h:59
TMVA::MethodDL::GetTrainingStrategyString
TString GetTrainingStrategyString() const
Definition: MethodDL.h:272
TMVA::MethodDL::ParseBatchNormLayer
void ParseBatchNormLayer(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.
Definition: MethodDL.cxx:892
TMVA::TTrainingSettings::momentum
Double_t momentum
Definition: MethodDL.h:81
TMVA::MethodDL::MethodDL
MethodDL(const TString &jobName, const TString &methodTitle, DataSetInfo &theData, const TString &theOption)
Constructor.
Definition: MethodDL.cxx:1021
Reference.h
TMVA::MethodDL::ScalarImpl_t
typename ArchitectureImpl_t::Scalar_t ScalarImpl_t
Definition: MethodDL.h:109
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TMVA::DNN::TCpu::Matrix_t
TCpuMatrix< AReal > Matrix_t
Definition: Cpu.h:71
TMVA::MethodDL::GetBatchDepth
size_t GetBatchDepth() const
Definition: MethodDL.h:258
TMVA::MethodDL::GetInputDepth
size_t GetInputDepth() const
Definition: MethodDL.h:251
TMVA::MethodDL
Definition: MethodDL.h:89
TMVA::MethodDL::GetWeightInitialization
DNN::EInitialization GetWeightInitialization() const
Definition: MethodDL.h:264
DeepNet.h
TMVA::TTrainingSettings::testInterval
size_t testInterval
Definition: MethodDL.h:74
TMVA::MethodDL::ParseConvLayer
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.
Definition: MethodDL.cxx:671
TMVA::MethodDL::GetMvaValues
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.
Definition: MethodDL.cxx:2023
type
int type
Definition: TGX11.cxx:121
TMVA::MethodDL::fRandomSeed
size_t fRandomSeed
The random seed used to initialize the weights and shuffling batches (default is zero)
Definition: MethodDL.h:182
TMVA::MethodDL::SetBatchSize
void SetBatchSize(size_t batchSize)
Definition: MethodDL.h:287
TMVA::MethodDL::GetBatchHeight
size_t GetBatchHeight() const
Definition: MethodDL.h:259
TMVA::MethodDL::GetErrorStrategyString
TString GetErrorStrategyString() const
Definition: MethodDL.h:271
TMVA::MethodDL::fBatchWidth
size_t fBatchWidth
The width of the batch used to train the deep net.
Definition: MethodDL.h:180
TMVA::MethodDL::GetInputWidth
size_t GetInputWidth() const
Definition: MethodDL.h:253
TMVA::MethodDL::GetOutputFunction
DNN::EOutputFunction GetOutputFunction() const
Definition: MethodDL.h:265
TMVA::MethodDL::fXInput
TensorImpl_t fXInput
Definition: MethodDL.h:202
TMVA::TTrainingSettings
All of the options that can be specified in the training string.
Definition: MethodDL.h:72
TMVA::MethodDL::fArchitectureString
TString fArchitectureString
The string defining the architecure: CPU or GPU.
Definition: MethodDL.h:194
TMVA::MethodDL::GetNumValidationSamples
UInt_t GetNumValidationSamples()
parce the validation string and return the number of event data used for validation
TMVA::MethodDL::TensorImpl_t
typename ArchitectureImpl_t::Tensor_t TensorImpl_t
Definition: MethodDL.h:108
TMVA::DNN::TDeepNet
Generic Deep Neural Network class.
Definition: DeepNet.h:73
TMVA::MethodDL::fBatchDepth
size_t fBatchDepth
The depth of the batch used to train the deep net.
Definition: MethodDL.h:178
TMVA::MethodDL::fBatchHeight
size_t fBatchHeight
The height of the batch used to train the deep net.
Definition: MethodDL.h:179
TMVA::TTrainingSettings::dropoutProbabilities
std::vector< Double_t > dropoutProbabilities
Definition: MethodDL.h:83
TMVA::MethodDL::SetInputShape
void SetInputShape(std::vector< size_t > inputShape)
Definition: MethodDL.h:285
TMVA::MethodDL::GetInputDim
size_t GetInputDim() const
Definition: MethodDL.h:254
TMVA
create variable transformations
Definition: GeneticMinimizer.h:22
TMVA::MethodDL::ReadWeightsFromXML
void ReadWeightsFromXML(void *wghtnode)
Definition: MethodDL.cxx:2121