Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
TMVA::DNN Namespace Reference

Namespaces

namespace  Blas
 
namespace  CNN
 
namespace  Cuda
 
namespace  RNN
 

Classes

class  Batch
 The Batch class encapsulates one mini-batch. More...
 
class  ClassificationSettings
 Settings for classificationused to distinguish between different function signatures. More...
 
struct  CudaActivationDescriptor
 
struct  CudaConvolutionBwdDataAlgo
 
struct  CudaConvolutionBwdFilterAlgo
 
struct  CudaConvolutionDescriptor
 
struct  CudaConvolutionFwdAlgo
 
struct  CudaDataType
 
struct  CudaDropoutDescriptor
 
struct  CudaEmptyDescriptor
 
struct  CudaFilterDescriptor
 
struct  CudaPoolingDescriptor
 
struct  DummyConvolutionBwdDataAlgo
 
struct  DummyConvolutionBwdFilterAlgo
 
struct  DummyConvolutionDescriptor
 
struct  DummyConvolutionFwdAlgo
 
struct  DummyCudaDataType
 
struct  DummyDataType
 
struct  DummyDescriptor
 
struct  DummyDropoutDescriptor
 
struct  DummyEmptyDescriptor
 
struct  DummyFilterDescriptor
 
struct  DummyPoolingDescriptor
 
class  Layer
 Layer defines the layout of a layer. More...
 
class  LayerData
 LayerData holds the data of one layer. More...
 
class  MeanVariance
 
class  Net
 neural net More...
 
class  Settings
 Settings for the training of the neural net. More...
 
class  Steepest
 Steepest Gradient Descent algorithm (SGD) More...
 
class  TAdadelta
 Adadelta Optimizer class. More...
 
class  TAdagrad
 Adagrad Optimizer class. More...
 
class  TAdam
 Adam Optimizer class. More...
 
class  TBatch
 TBatch. More...
 
class  TBatchIterator
 TBatchIterator. More...
 
class  TBatchNormLayer
 Layer implementing Batch Normalization. More...
 
class  TCpu
 The TCpu architecture class. More...
 
class  TCpuBuffer
 TCpuBuffer. More...
 
class  TCpuMatrix
 The TCpuMatrix class. More...
 
class  TCpuTensor
 
class  TCuda
 The TCuda architecture class. More...
 
class  TCudaDeviceBuffer
 TCudaDeviceBuffer. More...
 
class  TCudaDeviceReference
 TCudaDeviceReference. More...
 
class  TCudaHostBuffer
 TCudaHostBuffer. More...
 
class  TCudaMatrix
 TCudaMatrix Class. More...
 
class  TCudaTensor
 TCudaTensor Class. More...
 
class  TDataLoader
 TDataLoader. More...
 
class  TDataLoader< AData, TReference< AReal > >
 
class  TDeepNet
 Generic Deep Neural Network class. More...
 
class  TDenseLayer
 Generic layer class. More...
 
struct  TDescriptors
 
class  TDevice
 TDevice. More...
 
class  TDLGradientDescent
 
struct  TDNNGenDescriptors
 
class  TGradientDescent
 
class  TLayer
 Generic layer class. More...
 
class  TNet
 Generic neural network class. More...
 
class  TReference
 The reference architecture class. More...
 
class  TReshapeLayer
 
class  TRMSProp
 RMSProp Optimizer class. More...
 
class  TSGD
 Stochastic Batch Gradient Descent Optimizer class. More...
 
class  TSharedLayer
 Layer class width shared weight and bias layers. More...
 
class  TTensorBatch
 TTensorBatch. More...
 
class  TTensorBatchIterator
 TTensorBatchIterator. More...
 
class  TTensorDataLoader
 TTensorDataLoader. More...
 
class  TTensorDataLoader< AData, TReference< AReal > >
 
struct  TWorkspace
 
class  VGeneralLayer
 Generic General Layer class. More...
 
class  VOptimizer
 Generic Optimizer class. More...
 

Typedefs

typedef std::vector< char > DropContainer
 
using IndexIterator_t = typename std::vector<size_t>::iterator
 
using MatrixInput_t = std::tuple<const TMatrixT<Double_t> &, const TMatrixT<Double_t> &, const TMatrixT<Double_t> &>
 
using MemoryLayout = TMVA::Experimental::MemoryLayout
 
typedef std::tuple< Settings &, Batch &, DropContainer & > pass_through_type
 
using TensorInput
 
using TMVAInput_t
 

Enumerations

enum class  EActivationFunction {
  kIdentity = 0 , kRelu = 1 , kSigmoid = 2 , kTanh = 3 ,
  kSymmRelu = 4 , kSoftSign = 5 , kGauss = 6 , kFastTanh = 7
}
 Enum that represents layer activation functions. More...
 
enum class  EInitialization {
  kGauss = 'G' , kUniform = 'U' , kIdentity = 'I' , kZero = 'Z' ,
  kGlorotNormal = 'X' , kGlorotUniform = 'F'
}
 
enum class  ELossFunction { kCrossEntropy = 'C' , kMeanSquaredError = 'R' , kSoftmaxCrossEntropy = 'S' }
 Enum that represents objective functions for the net, i.e. More...
 
enum class  EnumFunction {
  ZERO = '0' , LINEAR = 'L' , TANH = 'T' , RELU = 'R' ,
  SYMMRELU = 'r' , TANHSHIFT = 't' , SIGMOID = 's' , SOFTSIGN = 'S' ,
  GAUSS = 'G' , GAUSSCOMPLEMENT = 'C'
}
 
enum class  EnumRegularization { NONE , L1 , L2 , L1MAX }
 
enum class  EOptimizer {
  kSGD = 0 , kAdam = 1 , kAdagrad = 2 , kRMSProp = 3 ,
  kAdadelta = 4
}
 Enum representing the optimizer used for training. More...
 
enum class  EOutputFunction { kIdentity = 'I' , kSigmoid = 'S' , kSoftmax = 'M' }
 Enum that represents output functions. More...
 
enum class  ERegularization { kNone = '0' , kL1 = '1' , kL2 = '2' }
 Enum representing the regularization type applied for a given layer. More...
 
enum  MinimizerType { fSteepest }
 < list all the minimizer types More...
 
enum class  ModeErrorFunction { SUMOFSQUARES = 'S' , CROSSENTROPY = 'C' , CROSSENTROPY_MUTUALEXCLUSIVE = 'M' }
 error functions to be chosen from More...
 
enum class  ModeOutput { FETCH }
 
enum class  ModeOutputValues : int { DIRECT = 0x01 , SIGMOID = 0x02 , SOFTMAX = 0x04 , BATCHNORMALIZATION = 0x08 }
 
enum class  WeightInitializationStrategy { XAVIER , TEST , LAYERSIZE , XAVIERUNIFORM }
 weight initialization strategies to be chosen from More...
 

Functions

template<typename Architecture_t >
void addRegularizationGradients (typename Architecture_t::Matrix_t &A, const typename Architecture_t::Matrix_t &W, typename Architecture_t::Scalar_t weightDecay, ERegularization R)
 Add the regularization gradient corresponding to weight matrix W, to the matrix A.
 
template<typename ItValue , typename Fnc >
void applyFunctions (ItValue itValue, ItValue itValueEnd, Fnc fnc)
 apply the activation functions
 
template<typename ItValue , typename Fnc , typename InvFnc , typename ItGradient >
void applyFunctions (ItValue itValue, ItValue itValueEnd, Fnc fnc, InvFnc invFnc, ItGradient itGradient)
 apply the activation functions and compute the gradient
 
template<typename ItValue , typename ItFunction >
void applyFunctions (ItValue itValue, ItValue itValueEnd, ItFunction itFunction)
 
template<typename ItValue , typename ItFunction , typename ItInverseFunction , typename ItGradient >
void applyFunctions (ItValue itValue, ItValue itValueEnd, ItFunction itFunction, ItInverseFunction itInverseFunction, ItGradient itGradient)
 
template<typename ItSource , typename ItWeight , typename ItTarget >
void applyWeights (ItSource itSourceBegin, ItSource itSourceEnd, ItWeight itWeight, ItTarget itTargetBegin, ItTarget itTargetEnd)
 
template<bool HasDropOut, typename ItSource , typename ItWeight , typename ItTarget , typename ItDrop >
void applyWeights (ItSource itSourceBegin, ItSource itSourceEnd, ItWeight itWeight, ItTarget itTargetBegin, ItTarget itTargetEnd, ItDrop itDrop)
 apply weights using drop-out; for no drop out, provide (&bool = true) to itDrop such that *itDrop becomes "true"
 
template<typename ItSource , typename ItWeight , typename ItPrev >
void applyWeightsBackwards (ItSource itCurrBegin, ItSource itCurrEnd, ItWeight itWeight, ItPrev itPrevBegin, ItPrev itPrevEnd)
 
template<bool HasDropOut, typename ItSource , typename ItWeight , typename ItPrev , typename ItDrop >
void applyWeightsBackwards (ItSource itCurrBegin, ItSource itCurrEnd, ItWeight itWeight, ItPrev itPrevBegin, ItPrev itPrevEnd, ItDrop itDrop)
 apply weights backwards (for backprop); for no drop out, provide (&bool = true) to itDrop such that *itDrop becomes "true"
 
template<typename LAYERDATA >
void backward (LAYERDATA &prevLayerData, LAYERDATA &currLayerData)
 backward application of the weights (back-propagation of the error)
 
template<EnumRegularization Regularization>
double computeRegularization (double weight, const double &factorWeightDecay)
 compute the regularization (L1, L2)
 
template<>
double computeRegularization< EnumRegularization::L1 > (double weight, const double &factorWeightDecay)
 
template<>
double computeRegularization< EnumRegularization::L2 > (double weight, const double &factorWeightDecay)
 
template<typename ItProbability , typename ItTruth , typename ItDelta , typename ItInvActFnc >
double crossEntropy (ItProbability itProbabilityBegin, ItProbability itProbabilityEnd, ItTruth itTruthBegin, ItTruth, ItDelta itDelta, ItDelta itDeltaEnd, ItInvActFnc, double patternWeight)
 cross entropy error function
 
void cudaError (cudaError_t code, const char *file, int line, bool abort=true)
 Function to check cuda return code.
 
__global__ void CurandInitializationKernel (unsigned long long seed, curandState_t *state)
 
template<typename Architecture >
auto debugTensor (const typename Architecture::Tensor_t &A, const std::string name="tensor") -> void
 
template<typename Architecture_t >
auto evaluate (ELossFunction f, const typename Architecture_t::Matrix_t &Y, const typename Architecture_t::Matrix_t &output, const typename Architecture_t::Matrix_t &weights) -> decltype(Architecture_t::CrossEntropy(Y, output, weights))
 Compute the value of the objective function f for given activations of the ouput layer and the truth Y.
 
template<typename Architecture_t >
void evaluate (typename Architecture_t::Matrix_t &A, EOutputFunction f, const typename Architecture_t::Matrix_t &X)
 Apply the given output function to each value in the given tensor A.
 
template<typename Architecture_t >
void evaluate (typename Architecture_t::Tensor_t &A, EActivationFunction f)
 Apply the given activation function to each value in the given tensor A.
 
template<typename Architecture_t >
void evaluateDerivative (typename Architecture_t::Tensor_t &B, EActivationFunction f, const typename Architecture_t::Tensor_t &A)
 Compute the first partial derivative of the activation function for the values given in tensor A and write the results into B.
 
template<typename Architecture_t >
void evaluateDerivativeMatrix (typename Architecture_t::Matrix_t &B, EActivationFunction f, const typename Architecture_t::Matrix_t &A)
 
template<typename Architecture_t >
void evaluateGradients (typename Architecture_t::Matrix_t &dY, ELossFunction f, const typename Architecture_t::Matrix_t &Y, const typename Architecture_t::Matrix_t &output, const typename Architecture_t::Matrix_t &weights)
 Compute the gradient of the given output function f for given activations output of the output layer and truth Y and write the results into dY.
 
template<typename Architecture_t >
void evaluateMatrix (typename Architecture_t::Matrix_t &A, EActivationFunction f)
 
template<typename LAYERDATA >
void forward (const LAYERDATA &prevLayerData, LAYERDATA &currLayerData)
 apply the weights (and functions) in forward direction of the DNN
 
double gaussDouble (double mean, double sigma)
 
template<typename Architecture_t >
void initialize (typename Architecture_t::Matrix_t &A, EInitialization m)
 
template<typename T >
bool isFlagSet (T flag, T value)
 
ModeOutputValues operator& (ModeOutputValues lhs, ModeOutputValues rhs)
 
ModeOutputValues operator&= (ModeOutputValues &lhs, ModeOutputValues rhs)
 
ModeOutputValues operator| (ModeOutputValues lhs, ModeOutputValues rhs)
 
ModeOutputValues operator|= (ModeOutputValues &lhs, ModeOutputValues rhs)
 
int randomInt (int maxValue)
 
template<typename Architecture_t >
auto regularization (const typename Architecture_t::Matrix_t &A, ERegularization R) -> decltype(Architecture_t::L1Regularization(A))
 Evaluate the regularization functional for a given weight matrix.
 
template<typename ItOutput , typename ItTruth , typename ItDelta , typename ItInvActFnc >
double softMaxCrossEntropy (ItOutput itProbabilityBegin, ItOutput itProbabilityEnd, ItTruth itTruthBegin, ItTruth, ItDelta itDelta, ItDelta itDeltaEnd, ItInvActFnc, double patternWeight)
 soft-max-cross-entropy error function (for mutual exclusive cross-entropy)
 
double studenttDouble (double distributionParameter)
 
template<typename ItOutput , typename ItTruth , typename ItDelta , typename ItInvActFnc >
double sumOfSquares (ItOutput itOutputBegin, ItOutput itOutputEnd, ItTruth itTruthBegin, ItTruth itTruthEnd, ItDelta itDelta, ItDelta itDeltaEnd, ItInvActFnc itInvActFnc, double patternWeight)
 
template<typename ItOutput , typename ItTruth , typename ItDelta , typename InvFnc >
double sumOfSquares (ItOutput itOutputBegin, ItOutput itOutputEnd, ItTruth itTruthBegin, ItTruth, ItDelta itDelta, ItDelta itDeltaEnd, InvFnc invFnc, double patternWeight)
 sum of squares error function
 
template<typename Container , typename T >
void uniformDouble (Container &container, T maxValue)
 
double uniformDouble (double minValue, double maxValue)
 
template<typename T >
uniformFromTo (T from, T to)
 
template<typename LAYERDATA >
void update (const LAYERDATA &prevLayerData, LAYERDATA &currLayerData, double factorWeightDecay, EnumRegularization regularization)
 update the node values
 
template<typename ItSource , typename ItDelta , typename ItTargetGradient , typename ItGradient >
void update (ItSource itSource, ItSource itSourceEnd, ItDelta itTargetDeltaBegin, ItDelta itTargetDeltaEnd, ItTargetGradient itTargetGradientBegin, ItGradient itGradient)
 update the gradients
 
template<EnumRegularization Regularization, typename ItSource , typename ItDelta , typename ItTargetGradient , typename ItGradient , typename ItWeight >
void update (ItSource itSource, ItSource itSourceEnd, ItDelta itTargetDeltaBegin, ItDelta itTargetDeltaEnd, ItTargetGradient itTargetGradientBegin, ItGradient itGradient, ItWeight itWeight, double weightDecay)
 update the gradients, using regularization
 
template<typename ItWeight >
double weightDecay (double error, ItWeight itWeight, ItWeight itWeightEnd, double factorWeightDecay, EnumRegularization eRegularization)
 compute the weight decay for regularization (L1 or L2)
 

Variables

std::shared_ptr< std::function< double(double)> > Gauss = std::make_shared<std::function<double(double)>> ([](double value){ const double s = 6.0; return exp (-std::pow(value*s,2.0)); })
 
std::shared_ptr< std::function< double(double)> > GaussComplement = std::make_shared<std::function<double(double)>> ([](double value){ const double s = 6.0; return 1.0 - exp (-std::pow(value*s,2.0)); })
 
std::shared_ptr< std::function< double(double)> > InvGauss = std::make_shared<std::function<double(double)>> ([](double value){ const double s = 6.0; return -2.0 * value * s*s * (*Gauss.get ()) (value); })
 
std::shared_ptr< std::function< double(double)> > InvGaussComplement = std::make_shared<std::function<double(double)>> ([](double value){ const double s = 6.0; return +2.0 * value * s*s * (*GaussComplement.get ()) (value); })
 
std::shared_ptr< std::function< double(double)> > InvLinear = std::make_shared<std::function<double(double)>> ([](double ){ return 1.0; })
 
std::shared_ptr< std::function< double(double)> > InvReLU = std::make_shared<std::function<double(double)>> ([](double value){ const double margin = 0.0; return value > margin ? 1.0 : 0; })
 
std::shared_ptr< std::function< double(double)> > InvSigmoid = std::make_shared<std::function<double(double)>> ([](double value){ double s = (*Sigmoid.get ()) (value); return s*(1.0-s); })
 
std::shared_ptr< std::function< double(double)> > InvSoftPlus = std::make_shared<std::function<double(double)>> ([](double value){ return 1.0 / (1.0 + std::exp (-value)); })
 
std::shared_ptr< std::function< double(double)> > InvSoftSign = std::make_shared<std::function<double(double)>> ([](double value){ return std::pow ((1.0 - fabs (value)),2.0); })
 
std::shared_ptr< std::function< double(double)> > InvSymmReLU = std::make_shared<std::function<double(double)>> ([](double value){ const double margin = 0.3; return value > margin ? 1.0 : value < -margin ? 1.0 : 0; })
 
std::shared_ptr< std::function< double(double)> > InvTanh = std::make_shared<std::function<double(double)>> ([](double value){ return 1.0 - std::pow (value, 2.0); })
 
std::shared_ptr< std::function< double(double)> > InvTanhShift = std::make_shared<std::function<double(double)>> ([](double value){ return 0.3 + (1.0 - std::pow (value, 2.0)); })
 
std::shared_ptr< std::function< double(double)> > Linear = std::make_shared<std::function<double(double)>> ([](double value){ return value; })
 
std::shared_ptr< std::function< double(double)> > ReLU = std::make_shared<std::function<double(double)>> ([](double value){ const double margin = 0.0; return value > margin ? value-margin : 0; })
 
std::shared_ptr< std::function< double(double)> > Sigmoid = std::make_shared<std::function<double(double)>> ([](double value){ value = std::max (-100.0, std::min (100.0,value)); return 1.0/(1.0 + std::exp (-value)); })
 
std::shared_ptr< std::function< double(double)> > SoftPlus = std::make_shared<std::function<double(double)>> ([](double value){ return std::log (1.0+ std::exp (value)); })
 
std::shared_ptr< std::function< double(double)> > SoftSign = std::make_shared<std::function<double(double)>> ([](double value){ return value / (1.0 + fabs (value)); })
 
std::shared_ptr< std::function< double(double)> > SymmReLU = std::make_shared<std::function<double(double)>> ([](double value){ const double margin = 0.3; return value > margin ? value-margin : value < -margin ? value+margin : 0; })
 
std::shared_ptr< std::function< double(double)> > Tanh = std::make_shared<std::function<double(double)>> ([](double value){ return tanh (value); })
 
std::shared_ptr< std::function< double(double)> > TanhShift = std::make_shared<std::function<double(double)>> ([](double value){ return tanh (value-0.3); })
 
std::shared_ptr< std::function< double(double)> > ZeroFnc = std::make_shared<std::function<double(double)>> ([](double ){ return 0; })
 

Typedef Documentation

◆ DropContainer

typedef std::vector<char> TMVA::DNN::DropContainer

Definition at line 227 of file NeuralNet.h.

◆ IndexIterator_t

typedef typename std::vector< size_t >::iterator TMVA::DNN::IndexIterator_t = typename std::vector<size_t>::iterator

Definition at line 42 of file DataLoader.h.

◆ MatrixInput_t

◆ MemoryLayout

◆ pass_through_type

Definition at line 1294 of file NeuralNet.h.

◆ TensorInput

Initial value:
std::tuple<const std::vector<TMatrixT<Double_t>> &, const TMatrixT<Double_t> &, const TMatrixT<Double_t> &>

Definition at line 43 of file TensorDataLoader.h.

◆ TMVAInput_t

typedef std::tuple< const std::vector< Event * > &, const DataSetInfo & > TMVA::DNN::TMVAInput_t
Initial value:
std::tuple<const std::vector<Event *> &, const DataSetInfo &>

Definition at line 39 of file DataLoader.h.

Enumeration Type Documentation

◆ EActivationFunction

Enum that represents layer activation functions.

Enumerator
kIdentity 
kRelu 
kSigmoid 
kTanh 
kSymmRelu 
kSoftSign 
kGauss 
kFastTanh 

Definition at line 31 of file Functions.h.

◆ EInitialization

Enumerator
kGauss 
kUniform 
kIdentity 
kZero 
kGlorotNormal 
kGlorotUniform 

Definition at line 72 of file Functions.h.

◆ ELossFunction

Enum that represents objective functions for the net, i.e.

functions that take the output from the last layer in the net together with the truths and return the objective function values that is to be minimized in the training process.

Enumerator
kCrossEntropy 
kMeanSquaredError 
kSoftmaxCrossEntropy 

Definition at line 56 of file Functions.h.

◆ EnumFunction

Enumerator
ZERO 
LINEAR 
TANH 
RELU 
SYMMRELU 
TANHSHIFT 
SIGMOID 
SOFTSIGN 
GAUSS 
GAUSSCOMPLEMENT 

Definition at line 156 of file NeuralNet.h.

◆ EnumRegularization

Enumerator
NONE 
L1 
L2 
L1MAX 

Definition at line 172 of file NeuralNet.h.

◆ EOptimizer

Enum representing the optimizer used for training.

Enumerator
kSGD 
kAdam 
kAdagrad 
kRMSProp 
kAdadelta 

Definition at line 82 of file Functions.h.

◆ EOutputFunction

Enum that represents output functions.

Enumerator
kIdentity 
kSigmoid 
kSoftmax 

Definition at line 45 of file Functions.h.

◆ ERegularization

Enum representing the regularization type applied for a given layer.

Enumerator
kNone 
kL1 
kL2 

Definition at line 64 of file Functions.h.

◆ MinimizerType

< list all the minimizer types

Enumerator
fSteepest 

SGD.

Definition at line 320 of file NeuralNet.h.

◆ ModeErrorFunction

error functions to be chosen from

Enumerator
SUMOFSQUARES 
CROSSENTROPY 
CROSSENTROPY_MUTUALEXCLUSIVE 

Definition at line 1038 of file NeuralNet.h.

◆ ModeOutput

Enumerator
FETCH 

Definition at line 1029 of file NeuralNet.h.

◆ ModeOutputValues

Enumerator
DIRECT 
SIGMOID 
SOFTMAX 
BATCHNORMALIZATION 

Definition at line 178 of file NeuralNet.h.

◆ WeightInitializationStrategy

weight initialization strategies to be chosen from

Enumerator
XAVIER 
TEST 
LAYERSIZE 
XAVIERUNIFORM 

Definition at line 1049 of file NeuralNet.h.

Function Documentation

◆ addRegularizationGradients()

template<typename Architecture_t >
void TMVA::DNN::addRegularizationGradients ( typename Architecture_t::Matrix_t & A,
const typename Architecture_t::Matrix_t & W,
typename Architecture_t::Scalar_t weightDecay,
ERegularization R )
inline

Add the regularization gradient corresponding to weight matrix W, to the matrix A.

Definition at line 258 of file Functions.h.

◆ applyFunctions() [1/4]

template<typename ItValue , typename Fnc >
void TMVA::DNN::applyFunctions ( ItValue itValue,
ItValue itValueEnd,
Fnc fnc )

apply the activation functions

Definition at line 147 of file NeuralNet.icc.

◆ applyFunctions() [2/4]

void TMVA::DNN::applyFunctions ( ItValue itValue,
ItValue itValueEnd,
Fnc fnc,
InvFnc invFnc,
ItGradient itGradient )

apply the activation functions and compute the gradient

Definition at line 164 of file NeuralNet.icc.

◆ applyFunctions() [3/4]

void TMVA::DNN::applyFunctions ( ItValue itValue,
ItValue itValueEnd,
ItFunction itFunction )

◆ applyFunctions() [4/4]

void TMVA::DNN::applyFunctions ( ItValue itValue,
ItValue itValueEnd,
ItFunction itFunction,
ItInverseFunction itInverseFunction,
ItGradient itGradient )

◆ applyWeights() [1/2]

void TMVA::DNN::applyWeights ( ItSource itSourceBegin,
ItSource itSourceEnd,
ItWeight itWeight,
ItTarget itTargetBegin,
ItTarget itTargetEnd )

◆ applyWeights() [2/2]

void TMVA::DNN::applyWeights ( ItSource itSourceBegin,
ItSource itSourceEnd,
ItWeight itWeight,
ItTarget itTargetBegin,
ItTarget itTargetEnd,
ItDrop itDrop )

apply weights using drop-out; for no drop out, provide (&bool = true) to itDrop such that *itDrop becomes "true"

itDrop correlates with itSourceBegin

Definition at line 91 of file NeuralNet.icc.

◆ applyWeightsBackwards() [1/2]

void TMVA::DNN::applyWeightsBackwards ( ItSource itCurrBegin,
ItSource itCurrEnd,
ItWeight itWeight,
ItPrev itPrevBegin,
ItPrev itPrevEnd )

◆ applyWeightsBackwards() [2/2]

void TMVA::DNN::applyWeightsBackwards ( ItSource itCurrBegin,
ItSource itCurrEnd,
ItWeight itWeight,
ItPrev itPrevBegin,
ItPrev itPrevEnd,
ItDrop itDrop )

apply weights backwards (for backprop); for no drop out, provide (&bool = true) to itDrop such that *itDrop becomes "true"

itDrop correlates with itPrev (to be in agreement with "applyWeights" where it correlates with itSources (same node as itTarget here in applyBackwards)

Definition at line 118 of file NeuralNet.icc.

◆ backward()

template<typename LAYERDATA >
void TMVA::DNN::backward ( LAYERDATA & prevLayerData,
LAYERDATA & currLayerData )

backward application of the weights (back-propagation of the error)

Definition at line 572 of file NeuralNet.icc.

◆ computeRegularization()

template<EnumRegularization Regularization>
double TMVA::DNN::computeRegularization ( double weight,
const double & factorWeightDecay )
inline

compute the regularization (L1, L2)

Definition at line 209 of file NeuralNet.icc.

◆ computeRegularization< EnumRegularization::L1 >()

template<>
double TMVA::DNN::computeRegularization< EnumRegularization::L1 > ( double weight,
const double & factorWeightDecay )
inline

Definition at line 219 of file NeuralNet.icc.

◆ computeRegularization< EnumRegularization::L2 >()

template<>
double TMVA::DNN::computeRegularization< EnumRegularization::L2 > ( double weight,
const double & factorWeightDecay )
inline

Definition at line 226 of file NeuralNet.icc.

◆ crossEntropy()

double TMVA::DNN::crossEntropy ( ItProbability itProbabilityBegin,
ItProbability itProbabilityEnd,
ItTruth itTruthBegin,
ItTruth itTruthEnd,
ItDelta itDelta,
ItDelta itDeltaEnd,
ItInvActFnc itInvActFnc,
double patternWeight )

cross entropy error function

Definition at line 412 of file NeuralNet.icc.

◆ cudaError()

void TMVA::DNN::cudaError ( cudaError_t code,
const char * file,
int line,
bool abort = true )
inline

Function to check cuda return code.

Taken from http://stackoverflow.com/questions/14038589/

Definition at line 198 of file CudaMatrix.h.

◆ CurandInitializationKernel()

__global__ void TMVA::DNN::CurandInitializationKernel ( unsigned long long seed,
curandState_t * state )

Definition at line 26 of file CudaMatrix.cu.

◆ debugTensor()

template<typename Architecture >
auto TMVA::DNN::debugTensor ( const typename Architecture::Tensor_t & A,
const std::string name = "tensor" ) -> void

Definition at line 582 of file GeneralLayer.h.

◆ evaluate() [1/3]

template<typename Architecture_t >
auto TMVA::DNN::evaluate ( ELossFunction f,
const typename Architecture_t::Matrix_t & Y,
const typename Architecture_t::Matrix_t & output,
const typename Architecture_t::Matrix_t & weights ) -> decltype(Architecture_t::CrossEntropy(Y, output, weights))
inline

Compute the value of the objective function f for given activations of the ouput layer and the truth Y.

Definition at line 198 of file Functions.h.

◆ evaluate() [2/3]

template<typename Architecture_t >
void TMVA::DNN::evaluate ( typename Architecture_t::Matrix_t & A,
EOutputFunction f,
const typename Architecture_t::Matrix_t & X )
inline

Apply the given output function to each value in the given tensor A.

Definition at line 175 of file Functions.h.

◆ evaluate() [3/3]

template<typename Architecture_t >
void TMVA::DNN::evaluate ( typename Architecture_t::Tensor_t & A,
EActivationFunction f )
inline

Apply the given activation function to each value in the given tensor A.

Definition at line 98 of file Functions.h.

◆ evaluateDerivative()

template<typename Architecture_t >
void TMVA::DNN::evaluateDerivative ( typename Architecture_t::Tensor_t & B,
EActivationFunction f,
const typename Architecture_t::Tensor_t & A )
inline

Compute the first partial derivative of the activation function for the values given in tensor A and write the results into B.

Definition at line 125 of file Functions.h.

◆ evaluateDerivativeMatrix()

template<typename Architecture_t >
void TMVA::DNN::evaluateDerivativeMatrix ( typename Architecture_t::Matrix_t & B,
EActivationFunction f,
const typename Architecture_t::Matrix_t & A )
inline

Definition at line 160 of file Functions.h.

◆ evaluateGradients()

template<typename Architecture_t >
void TMVA::DNN::evaluateGradients ( typename Architecture_t::Matrix_t & dY,
ELossFunction f,
const typename Architecture_t::Matrix_t & Y,
const typename Architecture_t::Matrix_t & output,
const typename Architecture_t::Matrix_t & weights )
inline

Compute the gradient of the given output function f for given activations output of the output layer and truth Y and write the results into dY.

Definition at line 215 of file Functions.h.

◆ evaluateMatrix()

template<typename Architecture_t >
void TMVA::DNN::evaluateMatrix ( typename Architecture_t::Matrix_t & A,
EActivationFunction f )
inline

Definition at line 152 of file Functions.h.

◆ forward()

template<typename LAYERDATA >
void TMVA::DNN::forward ( const LAYERDATA & prevLayerData,
LAYERDATA & currLayerData )

apply the weights (and functions) in forward direction of the DNN

Definition at line 546 of file NeuralNet.icc.

◆ gaussDouble()

double TMVA::DNN::gaussDouble ( double mean,
double sigma )

Definition at line 35 of file NeuralNet.cxx.

◆ initialize()

template<typename Architecture_t >
void TMVA::DNN::initialize ( typename Architecture_t::Matrix_t & A,
EInitialization m )
inline

Definition at line 282 of file Functions.h.

◆ isFlagSet()

template<typename T >
bool TMVA::DNN::isFlagSet ( T flag,
T value )

Definition at line 212 of file NeuralNet.h.

◆ operator&()

ModeOutputValues TMVA::DNN::operator& ( ModeOutputValues lhs,
ModeOutputValues rhs )
inline

Definition at line 199 of file NeuralNet.h.

◆ operator&=()

ModeOutputValues TMVA::DNN::operator&= ( ModeOutputValues & lhs,
ModeOutputValues rhs )
inline

Definition at line 204 of file NeuralNet.h.

◆ operator|()

ModeOutputValues TMVA::DNN::operator| ( ModeOutputValues lhs,
ModeOutputValues rhs )
inline

Definition at line 188 of file NeuralNet.h.

◆ operator|=()

ModeOutputValues TMVA::DNN::operator|= ( ModeOutputValues & lhs,
ModeOutputValues rhs )
inline

Definition at line 193 of file NeuralNet.h.

◆ randomInt()

int TMVA::DNN::randomInt ( int maxValue)

Definition at line 52 of file NeuralNet.cxx.

◆ regularization()

template<typename Architecture_t >
auto TMVA::DNN::regularization ( const typename Architecture_t::Matrix_t & A,
ERegularization R ) -> decltype(Architecture_t::L1Regularization(A))
inline

Evaluate the regularization functional for a given weight matrix.

Definition at line 238 of file Functions.h.

◆ softMaxCrossEntropy()

double TMVA::DNN::softMaxCrossEntropy ( ItOutput itProbabilityBegin,
ItOutput itProbabilityEnd,
ItTruth itTruthBegin,
ItTruth itTruthEnd,
ItDelta itDelta,
ItDelta itDeltaEnd,
ItInvActFnc itInvActFnc,
double patternWeight )

soft-max-cross-entropy error function (for mutual exclusive cross-entropy)

Definition at line 458 of file NeuralNet.icc.

◆ studenttDouble()

double TMVA::DNN::studenttDouble ( double distributionParameter)

Definition at line 60 of file NeuralNet.cxx.

◆ sumOfSquares() [1/2]

double TMVA::DNN::sumOfSquares ( ItOutput itOutputBegin,
ItOutput itOutputEnd,
ItTruth itTruthBegin,
ItTruth itTruthEnd,
ItDelta itDelta,
ItDelta itDeltaEnd,
ItInvActFnc itInvActFnc,
double patternWeight )

◆ sumOfSquares() [2/2]

double TMVA::DNN::sumOfSquares ( ItOutput itOutputBegin,
ItOutput itOutputEnd,
ItTruth itTruthBegin,
ItTruth ,
ItDelta itDelta,
ItDelta itDeltaEnd,
InvFnc invFnc,
double patternWeight )

sum of squares error function

Definition at line 382 of file NeuralNet.icc.

◆ uniformDouble() [1/2]

template<typename Container , typename T >
void TMVA::DNN::uniformDouble ( Container & container,
T maxValue )

Definition at line 42 of file NeuralNet.icc.

◆ uniformDouble() [2/2]

double TMVA::DNN::uniformDouble ( double minValue,
double maxValue )

Definition at line 43 of file NeuralNet.cxx.

◆ uniformFromTo()

template<typename T >
T TMVA::DNN::uniformFromTo ( T from,
T to )

Definition at line 34 of file NeuralNet.icc.

◆ update() [1/3]

template<typename LAYERDATA >
void TMVA::DNN::update ( const LAYERDATA & prevLayerData,
LAYERDATA & currLayerData,
double weightDecay,
EnumRegularization regularization )

update the node values

Definition at line 600 of file NeuralNet.icc.

◆ update() [2/3]

void TMVA::DNN::update ( ItSource itSource,
ItSource itSourceEnd,
ItDelta itTargetDeltaBegin,
ItDelta itTargetDeltaEnd,
ItTargetGradient itTargetGradientBegin,
ItGradient itGradient )

update the gradients

Definition at line 183 of file NeuralNet.icc.

◆ update() [3/3]

void TMVA::DNN::update ( ItSource itSource,
ItSource itSourceEnd,
ItDelta itTargetDeltaBegin,
ItDelta itTargetDeltaEnd,
ItTargetGradient itTargetGradientBegin,
ItGradient itGradient,
ItWeight itWeight,
double weightDecay )

update the gradients, using regularization

Definition at line 237 of file NeuralNet.icc.

◆ weightDecay()

template<typename ItWeight >
double TMVA::DNN::weightDecay ( double error,
ItWeight itWeight,
ItWeight itWeightEnd,
double factorWeightDecay,
EnumRegularization eRegularization )

compute the weight decay for regularization (L1 or L2)

Definition at line 498 of file NeuralNet.icc.

Variable Documentation

◆ Gauss

std::shared_ptr< std::function< double(double)> > TMVA::DNN::Gauss = std::make_shared<std::function<double(double)>> ([](double value){ const double s = 6.0; return exp (-std::pow(value*s,2.0)); })

Definition at line 12 of file NeuralNet.cxx.

◆ GaussComplement

std::shared_ptr< std::function< double(double)> > TMVA::DNN::GaussComplement = std::make_shared<std::function<double(double)>> ([](double value){ const double s = 6.0; return 1.0 - exp (-std::pow(value*s,2.0)); })

Definition at line 13 of file NeuralNet.cxx.

◆ InvGauss

std::shared_ptr< std::function< double(double)> > TMVA::DNN::InvGauss = std::make_shared<std::function<double(double)>> ([](double value){ const double s = 6.0; return -2.0 * value * s*s * (*Gauss.get ()) (value); })

Definition at line 14 of file NeuralNet.cxx.

◆ InvGaussComplement

std::shared_ptr< std::function< double(double)> > TMVA::DNN::InvGaussComplement = std::make_shared<std::function<double(double)>> ([](double value){ const double s = 6.0; return +2.0 * value * s*s * (*GaussComplement.get ()) (value); })

Definition at line 15 of file NeuralNet.cxx.

◆ InvLinear

std::shared_ptr< std::function< double(double)> > TMVA::DNN::InvLinear = std::make_shared<std::function<double(double)>> ([](double ){ return 1.0; })

Definition at line 16 of file NeuralNet.cxx.

◆ InvReLU

std::shared_ptr< std::function< double(double)> > TMVA::DNN::InvReLU = std::make_shared<std::function<double(double)>> ([](double value){ const double margin = 0.0; return value > margin ? 1.0 : 0; })

Definition at line 17 of file NeuralNet.cxx.

◆ InvSigmoid

std::shared_ptr< std::function< double(double)> > TMVA::DNN::InvSigmoid = std::make_shared<std::function<double(double)>> ([](double value){ double s = (*Sigmoid.get ()) (value); return s*(1.0-s); })

Definition at line 18 of file NeuralNet.cxx.

◆ InvSoftPlus

std::shared_ptr< std::function< double(double)> > TMVA::DNN::InvSoftPlus = std::make_shared<std::function<double(double)>> ([](double value){ return 1.0 / (1.0 + std::exp (-value)); })

Definition at line 19 of file NeuralNet.cxx.

◆ InvSoftSign

std::shared_ptr< std::function< double(double)> > TMVA::DNN::InvSoftSign = std::make_shared<std::function<double(double)>> ([](double value){ return std::pow ((1.0 - fabs (value)),2.0); })

Definition at line 20 of file NeuralNet.cxx.

◆ InvSymmReLU

std::shared_ptr< std::function< double(double)> > TMVA::DNN::InvSymmReLU = std::make_shared<std::function<double(double)>> ([](double value){ const double margin = 0.3; return value > margin ? 1.0 : value < -margin ? 1.0 : 0; })

Definition at line 21 of file NeuralNet.cxx.

◆ InvTanh

std::shared_ptr< std::function< double(double)> > TMVA::DNN::InvTanh = std::make_shared<std::function<double(double)>> ([](double value){ return 1.0 - std::pow (value, 2.0); })

Definition at line 22 of file NeuralNet.cxx.

◆ InvTanhShift

std::shared_ptr< std::function< double(double)> > TMVA::DNN::InvTanhShift = std::make_shared<std::function<double(double)>> ([](double value){ return 0.3 + (1.0 - std::pow (value, 2.0)); })

Definition at line 23 of file NeuralNet.cxx.

◆ Linear

std::shared_ptr< std::function< double(double)> > TMVA::DNN::Linear = std::make_shared<std::function<double(double)>> ([](double value){ return value; })

Definition at line 24 of file NeuralNet.cxx.

◆ ReLU

std::shared_ptr< std::function< double(double)> > TMVA::DNN::ReLU = std::make_shared<std::function<double(double)>> ([](double value){ const double margin = 0.0; return value > margin ? value-margin : 0; })

Definition at line 25 of file NeuralNet.cxx.

◆ Sigmoid

std::shared_ptr< std::function< double(double)> > TMVA::DNN::Sigmoid = std::make_shared<std::function<double(double)>> ([](double value){ value = std::max (-100.0, std::min (100.0,value)); return 1.0/(1.0 + std::exp (-value)); })

Definition at line 26 of file NeuralNet.cxx.

◆ SoftPlus

std::shared_ptr< std::function< double(double)> > TMVA::DNN::SoftPlus = std::make_shared<std::function<double(double)>> ([](double value){ return std::log (1.0+ std::exp (value)); })

Definition at line 27 of file NeuralNet.cxx.

◆ SoftSign

std::shared_ptr< std::function< double(double)> > TMVA::DNN::SoftSign = std::make_shared<std::function<double(double)>> ([](double value){ return value / (1.0 + fabs (value)); })

Definition at line 32 of file NeuralNet.cxx.

◆ SymmReLU

std::shared_ptr< std::function< double(double)> > TMVA::DNN::SymmReLU = std::make_shared<std::function<double(double)>> ([](double value){ const double margin = 0.3; return value > margin ? value-margin : value < -margin ? value+margin : 0; })

Definition at line 30 of file NeuralNet.cxx.

◆ Tanh

std::shared_ptr< std::function< double(double)> > TMVA::DNN::Tanh = std::make_shared<std::function<double(double)>> ([](double value){ return tanh (value); })

Definition at line 29 of file NeuralNet.cxx.

◆ TanhShift

std::shared_ptr< std::function< double(double)> > TMVA::DNN::TanhShift = std::make_shared<std::function<double(double)>> ([](double value){ return tanh (value-0.3); })

Definition at line 31 of file NeuralNet.cxx.

◆ ZeroFnc

std::shared_ptr< std::function< double(double)> > TMVA::DNN::ZeroFnc = std::make_shared<std::function<double(double)>> ([](double ){ return 0; })

Definition at line 28 of file NeuralNet.cxx.