Logo ROOT   6.18/05
Reference Guide
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TMVA::DNN::TDeepNet< Architecture_t, Layer_t > Class Template Reference

template<typename Architecture_t, typename Layer_t = VGeneralLayer<Architecture_t>>
class TMVA::DNN::TDeepNet< Architecture_t, Layer_t >

Generic Deep Neural Network class.

This classs encapsulates the information for all types of Deep Neural Networks.

Template Parameters
ArchitectureThe Architecture type that holds the architecture-specific data types.

Definition at line 74 of file DeepNet.h.

Public Types

using Matrix_t = typename Architecture_t::Matrix_t
 
using Scalar_t = typename Architecture_t::Scalar_t
 

Public Member Functions

 TDeepNet ()
 Default Constructor. More...
 
 TDeepNet (const TDeepNet &)
 Copy-constructor. More...
 
 TDeepNet (size_t BatchSize, size_t InputDepth, size_t InputHeight, size_t InputWidth, size_t BatchDepth, size_t BatchHeight, size_t BatchWidth, ELossFunction fJ, EInitialization fI=EInitialization::kZero, ERegularization fR=ERegularization::kNone, Scalar_t fWeightDecay=0.0, bool isTraining=false)
 Constructor. More...
 
 ~TDeepNet ()
 Destructor. More...
 
TBasicRNNLayer< Architecture_t > * AddBasicRNNLayer (size_t stateSize, size_t inputSize, size_t timeSteps, bool rememberState=false)
 Function for adding Recurrent Layer in the Deep Neural Network, with given parameters. More...
 
void AddBasicRNNLayer (TBasicRNNLayer< Architecture_t > *basicRNNLayer)
 Function for adding Vanilla RNN when the layer is already created. More...
 
TConvLayer< Architecture_t > * AddConvLayer (size_t depth, size_t filterHeight, size_t filterWidth, size_t strideRows, size_t strideCols, size_t paddingHeight, size_t paddingWidth, EActivationFunction f, Scalar_t dropoutProbability=1.0)
 Function for adding Convolution layer in the Deep Neural Network, with a given depth, filter height and width, striding in rows and columns, the zero paddings, as well as the activation function and the dropout probability. More...
 
void AddConvLayer (TConvLayer< Architecture_t > *convLayer)
 Function for adding Convolution Layer in the Deep Neural Network, when the layer is already created. More...
 
TDenseLayer< Architecture_t > * AddDenseLayer (size_t width, EActivationFunction f, Scalar_t dropoutProbability=1.0)
 Function for adding Dense Connected Layer in the Deep Neural Network, with a given width, activation function and dropout probability. More...
 
void AddDenseLayer (TDenseLayer< Architecture_t > *denseLayer)
 Function for adding Dense Layer in the Deep Neural Network, when the layer is already created. More...
 
void AddMaxPoolLayer (CNN::TMaxPoolLayer< Architecture_t > *maxPoolLayer)
 Function for adding Max Pooling layer in the Deep Neural Network, when the layer is already created. More...
 
TMaxPoolLayer< Architecture_t > * AddMaxPoolLayer (size_t frameHeight, size_t frameWidth, size_t strideRows, size_t strideCols, Scalar_t dropoutProbability=1.0)
 Function for adding Pooling layer in the Deep Neural Network, with a given filter height and width, striding in rows and columns as well as the dropout probability. More...
 
TReshapeLayer< Architecture_t > * AddReshapeLayer (size_t depth, size_t height, size_t width, bool flattening)
 Function for adding Reshape Layer in the Deep Neural Network, with a given height and width. More...
 
void AddReshapeLayer (TReshapeLayer< Architecture_t > *reshapeLayer)
 Function for adding Reshape Layer in the Deep Neural Network, when the layer is already created. More...
 
void Backward (std::vector< Matrix_t > &input, const Matrix_t &groundTruth, const Matrix_t &weights)
 Function that executes the entire backward pass in the network. More...
 
void Clear ()
 Remove all layers from the network. More...
 
void Forward (std::vector< Matrix_t > &input, bool applyDropout=false)
 Function that executes the entire forward pass in the network. More...
 
size_t GetBatchDepth () const
 
size_t GetBatchHeight () const
 
size_t GetBatchSize () const
 Getters. More...
 
size_t GetBatchWidth () const
 
size_t GetDepth () const
 
EInitialization GetInitialization () const
 
size_t GetInputDepth () const
 
size_t GetInputHeight () const
 
size_t GetInputWidth () const
 
Layer_t * GetLayerAt (size_t i)
 Get the layer in the vector of layers at poistion i. More...
 
const Layer_t * GetLayerAt (size_t i) const
 
std::vector< Layer_t * > & GetLayers ()
 
const std::vector< Layer_t * > & GetLayers () const
 
ELossFunction GetLossFunction () const
 
size_t GetOutputWidth () const
 
ERegularization GetRegularization () const
 
Scalar_t GetWeightDecay () const
 
void Initialize ()
 DAE functions. More...
 
bool IsTraining () const
 
Scalar_t Loss (const Matrix_t &groundTruth, const Matrix_t &weights, bool includeRegularization=true) const
 Function for evaluating the loss, based on the activations stored in the last layer. More...
 
Scalar_t Loss (std::vector< Matrix_t > &input, const Matrix_t &groundTruth, const Matrix_t &weights, bool applyDropout=false, bool includeRegularization=true)
 Function for evaluating the loss, based on the propagation of the given input. More...
 
void ParallelBackward (std::vector< TDeepNet< Architecture_t, Layer_t > > &nets, std::vector< TTensorBatch< Architecture_t > > &batches, Scalar_t learningRate)
 Function for parallel backward in the vector of deep nets, where the master net is the net calling this function and getting the updates from the other nets. More...
 
void ParallelBackwardMomentum (std::vector< TDeepNet< Architecture_t, Layer_t > > &nets, std::vector< TTensorBatch< Architecture_t > > &batches, Scalar_t learningRate, Scalar_t momentum)
 Function for parallel backward in the vector of deep nets, where the master net is the net calling this function and getting the updates from the other nets, following the momentum strategy. More...
 
void ParallelBackwardNestorov (std::vector< TDeepNet< Architecture_t, Layer_t > > &nets, std::vector< TTensorBatch< Architecture_t > > &batches, Scalar_t learningRate, Scalar_t momentum)
 Function for parallel backward in the vector of deep nets, where the master net is the net calling this function and getting the updates from the other nets, following the Nestorov momentum strategy. More...
 
void ParallelForward (std::vector< TDeepNet< Architecture_t, Layer_t > > &nets, std::vector< TTensorBatch< Architecture_t > > &batches, bool applyDropout=false)
 Function for parallel forward in the vector of deep nets, where the master net is the net calling this function. More...
 
void Prediction (Matrix_t &predictions, EOutputFunction f) const
 Prediction based on activations stored in the last layer. More...
 
void Prediction (Matrix_t &predictions, std::vector< Matrix_t > input, EOutputFunction f)
 Prediction for the given inputs, based on what network learned. More...
 
void Print () const
 Print the Deep Net Info. More...
 
Scalar_t RegularizationTerm () const
 Function for computing the regularizaton term to be added to the loss function
More...
 
void SetBatchDepth (size_t batchDepth)
 
void SetBatchHeight (size_t batchHeight)
 
void SetBatchSize (size_t batchSize)
 Setters. More...
 
void SetBatchWidth (size_t batchWidth)
 
void SetDropoutProbabilities (const std::vector< Double_t > &probabilities)
 
void SetInitialization (EInitialization I)
 
void SetInputDepth (size_t inputDepth)
 
void SetInputHeight (size_t inputHeight)
 
void SetInputWidth (size_t inputWidth)
 
void SetLossFunction (ELossFunction J)
 
void SetRegularization (ERegularization R)
 
void SetWeightDecay (Scalar_t weightDecay)
 
void Update (Scalar_t learningRate)
 Function that will update the weights and biases in the layers that contain weights and biases. More...
 

Private Member Functions

size_t calculateDimension (int imgDim, int fltDim, int padding, int stride)
 
bool isInteger (Scalar_t x) const
 

Private Attributes

size_t fBatchDepth
 The depth of the batch used for training/testing. More...
 
size_t fBatchHeight
 The height of the batch used for training/testing. More...
 
size_t fBatchSize
 Batch size used for training and evaluation. More...
 
size_t fBatchWidth
 The width of the batch used for training/testing. More...
 
EInitialization fI
 The initialization method of the network. More...
 
size_t fInputDepth
 The depth of the input. More...
 
size_t fInputHeight
 The height of the input. More...
 
size_t fInputWidth
 The width of the input. More...
 
bool fIsTraining
 Is the network training? More...
 
ELossFunction fJ
 The loss function of the network. More...
 
std::vector< Layer_t * > fLayers
 The layers consisting the DeepNet. More...
 
ERegularization fR
 The regularization used for the network. More...
 
Scalar_t fWeightDecay
 The weight decay factor. More...
 

#include <TMVA/DNN/DeepNet.h>

Member Typedef Documentation

◆ Matrix_t

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
using TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::Matrix_t = typename Architecture_t::Matrix_t

Definition at line 76 of file DeepNet.h.

◆ Scalar_t

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
using TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::Scalar_t = typename Architecture_t::Scalar_t

Definition at line 77 of file DeepNet.h.

Constructor & Destructor Documentation

◆ TDeepNet() [1/3]

template<typename Architecture_t , typename Layer_t >
TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::TDeepNet

Default Constructor.

Definition at line 345 of file DeepNet.h.

◆ TDeepNet() [2/3]

template<typename Architecture_t , typename Layer_t >
TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::TDeepNet ( size_t  BatchSize,
size_t  InputDepth,
size_t  InputHeight,
size_t  InputWidth,
size_t  BatchDepth,
size_t  BatchHeight,
size_t  BatchWidth,
ELossFunction  fJ,
EInitialization  fI = EInitialization::kZero,
ERegularization  fR = ERegularization::kNone,
Scalar_t  fWeightDecay = 0.0,
bool  isTraining = false 
)

Constructor.

Definition at line 355 of file DeepNet.h.

◆ TDeepNet() [3/3]

template<typename Architecture_t , typename Layer_t >
TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::TDeepNet ( const TDeepNet< Architecture_t, Layer_t > &  deepNet)

Copy-constructor.

Definition at line 367 of file DeepNet.h.

◆ ~TDeepNet()

template<typename Architecture_t , typename Layer_t >
TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::~TDeepNet

Destructor.

Definition at line 378 of file DeepNet.h.

Member Function Documentation

◆ AddBasicRNNLayer() [1/2]

template<typename Architecture_t , typename Layer_t >
TBasicRNNLayer< Architecture_t > * TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::AddBasicRNNLayer ( size_t  stateSize,
size_t  inputSize,
size_t  timeSteps,
bool  rememberState = false 
)

Function for adding Recurrent Layer in the Deep Neural Network, with given parameters.

Definition at line 488 of file DeepNet.h.

◆ AddBasicRNNLayer() [2/2]

template<typename Architecture_t , typename Layer_t >
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::AddBasicRNNLayer ( TBasicRNNLayer< Architecture_t > *  basicRNNLayer)

Function for adding Vanilla RNN when the layer is already created.

Definition at line 521 of file DeepNet.h.

◆ AddConvLayer() [1/2]

template<typename Architecture_t , typename Layer_t >
TConvLayer< Architecture_t > * TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::AddConvLayer ( size_t  depth,
size_t  filterHeight,
size_t  filterWidth,
size_t  strideRows,
size_t  strideCols,
size_t  paddingHeight,
size_t  paddingWidth,
EActivationFunction  f,
Scalar_t  dropoutProbability = 1.0 
)

Function for adding Convolution layer in the Deep Neural Network, with a given depth, filter height and width, striding in rows and columns, the zero paddings, as well as the activation function and the dropout probability.

Based on these parameters, it calculates the width and height of the convolutional layer.

Definition at line 403 of file DeepNet.h.

◆ AddConvLayer() [2/2]

template<typename Architecture_t , typename Layer_t >
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::AddConvLayer ( TConvLayer< Architecture_t > *  convLayer)

Function for adding Convolution Layer in the Deep Neural Network, when the layer is already created.


Definition at line 442 of file DeepNet.h.

◆ AddDenseLayer() [1/2]

template<typename Architecture_t , typename Layer_t >
TDenseLayer< Architecture_t > * TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::AddDenseLayer ( size_t  width,
EActivationFunction  f,
Scalar_t  dropoutProbability = 1.0 
)

Function for adding Dense Connected Layer in the Deep Neural Network, with a given width, activation function and dropout probability.

Based on the previous layer dimensions, it calculates the input width of the fully connected layer.

Definition at line 618 of file DeepNet.h.

◆ AddDenseLayer() [2/2]

template<typename Architecture_t , typename Layer_t >
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::AddDenseLayer ( TDenseLayer< Architecture_t > *  denseLayer)

Function for adding Dense Layer in the Deep Neural Network, when the layer is already created.

Definition at line 644 of file DeepNet.h.

◆ AddMaxPoolLayer() [1/2]

template<typename Architecture_t , typename Layer_t >
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::AddMaxPoolLayer ( CNN::TMaxPoolLayer< Architecture_t > *  maxPoolLayer)

Function for adding Max Pooling layer in the Deep Neural Network, when the layer is already created.

Definition at line 481 of file DeepNet.h.

◆ AddMaxPoolLayer() [2/2]

template<typename Architecture_t , typename Layer_t >
TMaxPoolLayer< Architecture_t > * TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::AddMaxPoolLayer ( size_t  frameHeight,
size_t  frameWidth,
size_t  strideRows,
size_t  strideCols,
Scalar_t  dropoutProbability = 1.0 
)

Function for adding Pooling layer in the Deep Neural Network, with a given filter height and width, striding in rows and columns as well as the dropout probability.

The depth is same as the previous layer depth. Based on these parameters, it calculates the width and height of the pooling layer.

Definition at line 449 of file DeepNet.h.

◆ AddReshapeLayer() [1/2]

template<typename Architecture_t , typename Layer_t >
TReshapeLayer< Architecture_t > * TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::AddReshapeLayer ( size_t  depth,
size_t  height,
size_t  width,
bool  flattening 
)

Function for adding Reshape Layer in the Deep Neural Network, with a given height and width.

It will take every matrix from the previous layer and reshape it to a matrix with new dimensions.

Definition at line 651 of file DeepNet.h.

◆ AddReshapeLayer() [2/2]

template<typename Architecture_t , typename Layer_t >
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::AddReshapeLayer ( TReshapeLayer< Architecture_t > *  reshapeLayer)

Function for adding Reshape Layer in the Deep Neural Network, when the layer is already created.

Definition at line 703 of file DeepNet.h.

◆ Backward()

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::Backward ( std::vector< Matrix_t > &  input,
const Matrix_t groundTruth,
const Matrix_t weights 
)

Function that executes the entire backward pass in the network.

Definition at line 889 of file DeepNet.h.

◆ calculateDimension()

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::calculateDimension ( int  imgDim,
int  fltDim,
int  padding,
int  stride 
)
private

Definition at line 385 of file DeepNet.h.

◆ Clear()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::Clear ( )
inline

Remove all layers from the network.

Definition at line 301 of file DeepNet.h.

◆ Forward()

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::Forward ( std::vector< Matrix_t > &  input,
bool  applyDropout = false 
)

Function that executes the entire forward pass in the network.

Definition at line 734 of file DeepNet.h.

◆ GetBatchDepth()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetBatchDepth ( ) const
inline

Definition at line 309 of file DeepNet.h.

◆ GetBatchHeight()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetBatchHeight ( ) const
inline

Definition at line 310 of file DeepNet.h.

◆ GetBatchSize()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetBatchSize ( ) const
inline

Getters.

Definition at line 304 of file DeepNet.h.

◆ GetBatchWidth()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetBatchWidth ( ) const
inline

Definition at line 311 of file DeepNet.h.

◆ GetDepth()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetDepth ( ) const
inline

Definition at line 293 of file DeepNet.h.

◆ GetInitialization()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
EInitialization TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetInitialization ( ) const
inline

Definition at line 316 of file DeepNet.h.

◆ GetInputDepth()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetInputDepth ( ) const
inline

Definition at line 305 of file DeepNet.h.

◆ GetInputHeight()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetInputHeight ( ) const
inline

Definition at line 306 of file DeepNet.h.

◆ GetInputWidth()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetInputWidth ( ) const
inline

Definition at line 307 of file DeepNet.h.

◆ GetLayerAt() [1/2]

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
Layer_t * TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetLayerAt ( size_t  i)
inline

Get the layer in the vector of layers at poistion i.

Definition at line 289 of file DeepNet.h.

◆ GetLayerAt() [2/2]

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
const Layer_t * TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetLayerAt ( size_t  i) const
inline

Definition at line 290 of file DeepNet.h.

◆ GetLayers() [1/2]

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
std::vector< Layer_t * > & TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetLayers ( )
inline

Definition at line 297 of file DeepNet.h.

◆ GetLayers() [2/2]

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
const std::vector< Layer_t * > & TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetLayers ( ) const
inline

Definition at line 298 of file DeepNet.h.

◆ GetLossFunction()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
ELossFunction TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetLossFunction ( ) const
inline

Definition at line 315 of file DeepNet.h.

◆ GetOutputWidth()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetOutputWidth ( ) const
inline

Definition at line 294 of file DeepNet.h.

◆ GetRegularization()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
ERegularization TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetRegularization ( ) const
inline

Definition at line 317 of file DeepNet.h.

◆ GetWeightDecay()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
Scalar_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::GetWeightDecay ( ) const
inline

Definition at line 318 of file DeepNet.h.

◆ Initialize()

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::Initialize

DAE functions.

Function for initialization of the Neural Net.

Definition at line 710 of file DeepNet.h.

◆ isInteger()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
bool TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::isInteger ( Scalar_t  x) const
inlineprivate

Definition at line 80 of file DeepNet.h.

◆ IsTraining()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
bool TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::IsTraining ( ) const
inline

Definition at line 313 of file DeepNet.h.

◆ Loss() [1/2]

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::Loss ( const Matrix_t groundTruth,
const Matrix_t weights,
bool  includeRegularization = true 
) const

Function for evaluating the loss, based on the activations stored in the last layer.

Definition at line 1092 of file DeepNet.h.

◆ Loss() [2/2]

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::Loss ( std::vector< Matrix_t > &  input,
const Matrix_t groundTruth,
const Matrix_t weights,
bool  applyDropout = false,
bool  includeRegularization = true 
)

Function for evaluating the loss, based on the propagation of the given input.

Definition at line 1108 of file DeepNet.h.

◆ ParallelBackward()

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::ParallelBackward ( std::vector< TDeepNet< Architecture_t, Layer_t > > &  nets,
std::vector< TTensorBatch< Architecture_t > > &  batches,
Scalar_t  learningRate 
)

Function for parallel backward in the vector of deep nets, where the master net is the net calling this function and getting the updates from the other nets.

There is one batch for one deep net.

Definition at line 911 of file DeepNet.h.

◆ ParallelBackwardMomentum()

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::ParallelBackwardMomentum ( std::vector< TDeepNet< Architecture_t, Layer_t > > &  nets,
std::vector< TTensorBatch< Architecture_t > > &  batches,
Scalar_t  learningRate,
Scalar_t  momentum 
)

Function for parallel backward in the vector of deep nets, where the master net is the net calling this function and getting the updates from the other nets, following the momentum strategy.

There is one batch for one deep net.

Definition at line 958 of file DeepNet.h.

◆ ParallelBackwardNestorov()

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::ParallelBackwardNestorov ( std::vector< TDeepNet< Architecture_t, Layer_t > > &  nets,
std::vector< TTensorBatch< Architecture_t > > &  batches,
Scalar_t  learningRate,
Scalar_t  momentum 
)

Function for parallel backward in the vector of deep nets, where the master net is the net calling this function and getting the updates from the other nets, following the Nestorov momentum strategy.

There is one batch for one deep net.

Definition at line 1021 of file DeepNet.h.

◆ ParallelForward()

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::ParallelForward ( std::vector< TDeepNet< Architecture_t, Layer_t > > &  nets,
std::vector< TTensorBatch< Architecture_t > > &  batches,
bool  applyDropout = false 
)

Function for parallel forward in the vector of deep nets, where the master net is the net calling this function.

There is one batch for one deep net.

Definition at line 745 of file DeepNet.h.

◆ Prediction() [1/2]

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::Prediction ( Matrix_t predictions,
EOutputFunction  f 
) const

Prediction based on activations stored in the last layer.

Definition at line 1132 of file DeepNet.h.

◆ Prediction() [2/2]

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::Prediction ( Matrix_t predictions,
std::vector< Matrix_t input,
EOutputFunction  f 
)

Prediction for the given inputs, based on what network learned.

Definition at line 1140 of file DeepNet.h.

◆ Print()

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::Print

Print the Deep Net Info.

Definition at line 1150 of file DeepNet.h.

◆ RegularizationTerm()

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::RegularizationTerm

Function for computing the regularizaton term to be added to the loss function

Definition at line 1118 of file DeepNet.h.

◆ SetBatchDepth()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::SetBatchDepth ( size_t  batchDepth)
inline

Definition at line 328 of file DeepNet.h.

◆ SetBatchHeight()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::SetBatchHeight ( size_t  batchHeight)
inline

Definition at line 329 of file DeepNet.h.

◆ SetBatchSize()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::SetBatchSize ( size_t  batchSize)
inline

Setters.

Definition at line 324 of file DeepNet.h.

◆ SetBatchWidth()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::SetBatchWidth ( size_t  batchWidth)
inline

Definition at line 330 of file DeepNet.h.

◆ SetDropoutProbabilities()

template<typename Architecture_t , typename Layer_t >
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::SetDropoutProbabilities ( const std::vector< Double_t > &  probabilities)

Definition at line 1169 of file DeepNet.h.

◆ SetInitialization()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::SetInitialization ( EInitialization  I)
inline

Definition at line 332 of file DeepNet.h.

◆ SetInputDepth()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::SetInputDepth ( size_t  inputDepth)
inline

Definition at line 325 of file DeepNet.h.

◆ SetInputHeight()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::SetInputHeight ( size_t  inputHeight)
inline

Definition at line 326 of file DeepNet.h.

◆ SetInputWidth()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::SetInputWidth ( size_t  inputWidth)
inline

Definition at line 327 of file DeepNet.h.

◆ SetLossFunction()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::SetLossFunction ( ELossFunction  J)
inline

Definition at line 331 of file DeepNet.h.

◆ SetRegularization()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::SetRegularization ( ERegularization  R)
inline

Definition at line 333 of file DeepNet.h.

◆ SetWeightDecay()

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
void TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::SetWeightDecay ( Scalar_t  weightDecay)
inline

Definition at line 334 of file DeepNet.h.

◆ Update()

template<typename Architecture_t , typename Layer_t >
auto TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::Update ( Scalar_t  learningRate)

Function that will update the weights and biases in the layers that contain weights and biases.


Definition at line 1083 of file DeepNet.h.

Member Data Documentation

◆ fBatchDepth

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::fBatchDepth
private

The depth of the batch used for training/testing.

Definition at line 91 of file DeepNet.h.

◆ fBatchHeight

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::fBatchHeight
private

The height of the batch used for training/testing.

Definition at line 92 of file DeepNet.h.

◆ fBatchSize

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::fBatchSize
private

Batch size used for training and evaluation.

Definition at line 86 of file DeepNet.h.

◆ fBatchWidth

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::fBatchWidth
private

The width of the batch used for training/testing.

Definition at line 93 of file DeepNet.h.

◆ fI

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
EInitialization TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::fI
private

The initialization method of the network.

Definition at line 98 of file DeepNet.h.

◆ fInputDepth

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::fInputDepth
private

The depth of the input.

Definition at line 87 of file DeepNet.h.

◆ fInputHeight

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::fInputHeight
private

The height of the input.

Definition at line 88 of file DeepNet.h.

◆ fInputWidth

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
size_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::fInputWidth
private

The width of the input.

Definition at line 89 of file DeepNet.h.

◆ fIsTraining

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
bool TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::fIsTraining
private

Is the network training?

Definition at line 95 of file DeepNet.h.

◆ fJ

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
ELossFunction TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::fJ
private

The loss function of the network.

Definition at line 97 of file DeepNet.h.

◆ fLayers

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
std::vector<Layer_t *> TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::fLayers
private

The layers consisting the DeepNet.

Definition at line 84 of file DeepNet.h.

◆ fR

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
ERegularization TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::fR
private

The regularization used for the network.

Definition at line 99 of file DeepNet.h.

◆ fWeightDecay

template<typename Architecture_t , typename Layer_t = VGeneralLayer<Architecture_t>>
Scalar_t TMVA::DNN::TDeepNet< Architecture_t, Layer_t >::fWeightDecay
private

The weight decay factor.

Definition at line 100 of file DeepNet.h.


The documentation for this class was generated from the following file: