Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TMVA::DNN::LayerData Class Reference

LayerData holds the data of one layer.

LayerData holds the data of one layer, but not its layout

Definition at line 436 of file NeuralNet.h.

Public Types

typedef DropContainer::const_iterator const_dropout_iterator
 
typedef function_container_type::const_iterator const_function_iterator_type
 
typedef container_type::const_iterator const_iterator_type
 
typedef std::vector< doublecontainer_type
 
typedef std::vector< std::function< double(double)> > function_container_type
 
typedef function_container_type::iterator function_iterator_type
 
typedef container_type::iterator iterator_type
 

Public Member Functions

 LayerData (const LayerData &other)
 copy c'tor of LayerData
 
 LayerData (const_iterator_type itInputBegin, const_iterator_type itInputEnd, ModeOutputValues eModeOutput=ModeOutputValues::DIRECT)
 c'tor of LayerData
 
 LayerData (LayerData &&other)
 move c'tor of LayerData
 
 LayerData (size_t inputSize)
 c'tor of LayerData
 
 LayerData (size_t size, const_iterator_type itWeightBegin, iterator_type itGradientBegin, std::shared_ptr< std::function< double(double)> > activationFunction, std::shared_ptr< std::function< double(double)> > inverseActivationFunction, ModeOutputValues eModeOutput=ModeOutputValues::DIRECT)
 c'tor of LayerData
 
 LayerData (size_t size, const_iterator_type itWeightBegin, std::shared_ptr< std::function< double(double)> > activationFunction, ModeOutputValues eModeOutput=ModeOutputValues::DIRECT)
 c'tor of LayerData
 
 ~LayerData ()
 
std::shared_ptr< std::function< double(double)> > activationFunction () const
 
void clear ()
 clear the values and the deltas
 
void clearDropOut ()
 clear the drop-out-data for this layer
 
iterator_type deltasBegin ()
 returns iterator to the begin of the deltas (back-propagation)
 
const_iterator_type deltasBegin () const
 returns const iterator to the begin of the deltas (back-propagation)
 
iterator_type deltasEnd ()
 returns iterator to the end of the deltas (back-propagation)
 
const_iterator_type deltasEnd () const
 returns const iterator to the end of the deltas (back-propagation)
 
const_dropout_iterator dropOut () const
 return the begin of the drop-out information
 
iterator_type gradientsBegin ()
 returns iterator to the begin of the gradients
 
const_iterator_type gradientsBegin () const
 returns const iterator to the begin of the gradients
 
bool hasDropOut () const
 has this layer drop-out turned on?
 
std::shared_ptr< std::function< double(double)> > inverseActivationFunction () const
 
ModeOutputValues outputMode () const
 returns the output mode
 
container_type probabilities () const
 computes the probabilities from the current node values and returns them
 
template<typename Iterator >
void setDropOut (Iterator itDrop)
 set the drop-out info for this layer
 
void setInput (const_iterator_type itInputBegin, const_iterator_type itInputEnd)
 change the input iterators
 
size_t size () const
 return the size of the layer
 
iterator_type valueGradientsBegin ()
 returns iterator to the begin of the gradients of the node values
 
const_iterator_type valueGradientsBegin () const
 returns const iterator to the begin of the gradients
 
iterator_type valueGradientsEnd ()
 returns iterator to the end of the gradients of the node values
 
const_iterator_type valueGradientsEnd () const
 returns const iterator to the end of the gradients
 
iterator_type valuesBegin ()
 returns iterator to the begin of the (node) values
 
const_iterator_type valuesBegin () const
 returns const iterator to the begin of the (node) values
 
iterator_type valuesEnd ()
 returns iterator to the end of the (node) values
 
const_iterator_type valuesEnd () const
 returns iterator to the end of the (node) values
 
const_iterator_type weightsBegin () const
 returns const iterator to the begin of the weights for this layer
 

Private Member Functions

container_type computeProbabilities () const
 compute the probabilities from the node values
 

Private Attributes

std::shared_ptr< std::function< double(double)> > m_activationFunction
 activation function for this layer
 
std::vector< doublem_deltas
 stores the deltas for the DNN training
 
ModeOutputValues m_eModeOutput
 stores the output mode (DIRECT, SIGMOID, SOFTMAX)
 
bool m_hasDropOut
 dropOut is turned on?
 
bool m_hasGradients
 does this layer have gradients (only if in training mode)
 
bool m_hasWeights
 does this layer have weights (it does not if it is the input layer)
 
std::shared_ptr< std::function< double(double)> > m_inverseActivationFunction
 inverse activation function for this layer
 
bool m_isInputLayer
 is this layer an input layer
 
const_iterator_type m_itConstWeightBegin
 const iterator to the first weight of this layer in the weight vector
 
const_dropout_iterator m_itDropOut
 iterator to a container indicating if the corresponding node is to be dropped
 
iterator_type m_itGradientBegin
 iterator to the first gradient of this layer in the gradient vector
 
const_iterator_type m_itInputBegin
 iterator to the first of the nodes in the input node vector
 
const_iterator_type m_itInputEnd
 iterator to the end of the nodes in the input node vector
 
size_t m_size
 
std::vector< doublem_valueGradients
 stores the gradients of the values (nodes)
 
std::vector< doublem_values
 stores the values of the nodes in this layer
 

#include <TMVA/NeuralNet.h>

Member Typedef Documentation

◆ const_dropout_iterator

typedef DropContainer::const_iterator TMVA::DNN::LayerData::const_dropout_iterator

Definition at line 448 of file NeuralNet.h.

◆ const_function_iterator_type

typedef function_container_type::const_iterator TMVA::DNN::LayerData::const_function_iterator_type

Definition at line 446 of file NeuralNet.h.

◆ const_iterator_type

typedef container_type::const_iterator TMVA::DNN::LayerData::const_iterator_type

Definition at line 442 of file NeuralNet.h.

◆ container_type

Definition at line 439 of file NeuralNet.h.

◆ function_container_type

typedef std::vector<std::function<double(double)> > TMVA::DNN::LayerData::function_container_type

Definition at line 444 of file NeuralNet.h.

◆ function_iterator_type

typedef function_container_type::iterator TMVA::DNN::LayerData::function_iterator_type

Definition at line 445 of file NeuralNet.h.

◆ iterator_type

typedef container_type::iterator TMVA::DNN::LayerData::iterator_type

Definition at line 441 of file NeuralNet.h.

Constructor & Destructor Documentation

◆ LayerData() [1/6]

TMVA::DNN::LayerData::LayerData ( const_iterator_type  itInputBegin,
const_iterator_type  itInputEnd,
ModeOutputValues  eModeOutput = ModeOutputValues::DIRECT 
)

c'tor of LayerData

C'tor of LayerData for the input layer

Parameters
itInputBeginiterator to the begin of a vector which holds the values of the nodes of the neural net
itInputEnditerator to the end of a vector which holdsd the values of the nodes of the neural net
eModeOutputindicates a potential tranformation of the output values before further computation DIRECT does not further transformation; SIGMOID applies a sigmoid transformation to each output value (to create a probability); SOFTMAX applies a softmax transformation to all output values (mutually exclusive probability)

Definition at line 81 of file NeuralNet.cxx.

◆ LayerData() [2/6]

TMVA::DNN::LayerData::LayerData ( size_t  inputSize)

c'tor of LayerData

C'tor of LayerData for the input layer

Parameters
inputSizeinput size of this layer

Definition at line 68 of file NeuralNet.cxx.

◆ ~LayerData()

TMVA::DNN::LayerData::~LayerData ( )
inline

Definition at line 471 of file NeuralNet.h.

◆ LayerData() [3/6]

TMVA::DNN::LayerData::LayerData ( size_t  size,
const_iterator_type  itWeightBegin,
iterator_type  itGradientBegin,
std::shared_ptr< std::function< double(double)> >  activationFunction,
std::shared_ptr< std::function< double(double)> >  inverseActivationFunction,
ModeOutputValues  eModeOutput = ModeOutputValues::DIRECT 
)

c'tor of LayerData

C'tor of LayerData for all layers which are not the input layer; Used during the training of the DNN

Parameters
sizesize of the layer
itWeightBeginindicates the start of the weights for this layer on the weight vector
itGradientBeginindicates the start of the gradients for this layer on the gradient vector
activationFunctionindicates activation functions for this layer
inverseActivationFunctionindicates the inverse activation functions for this layer
eModeOutputindicates a potential tranformation of the output values before further computation DIRECT does not further transformation; SIGMOID applies a sigmoid transformation to each output value (to create a probability); SOFTMAX applies a softmax transformation to all output values (mutually exclusive probability)

Definition at line 97 of file NeuralNet.cxx.

◆ LayerData() [4/6]

TMVA::DNN::LayerData::LayerData ( size_t  size,
const_iterator_type  itWeightBegin,
std::shared_ptr< std::function< double(double)> >  activationFunction,
ModeOutputValues  eModeOutput = ModeOutputValues::DIRECT 
)

c'tor of LayerData

C'tor of LayerData for all layers which are not the input layer; Used during the application of the DNN

Parameters
sizesize of the layer
itWeightBeginindicates the start of the weights for this layer on the weight vector
activationFunctionindicates the activation function for this layer
eModeOutputindicates a potential tranformation of the output values before further computation DIRECT does not further transformation; SIGMOID applies a sigmoid transformation to each output value (to create a probability); SOFTMAX applies a softmax transformation to all output values (mutually exclusive probability)

Definition at line 122 of file NeuralNet.cxx.

◆ LayerData() [5/6]

TMVA::DNN::LayerData::LayerData ( const LayerData other)
inline

copy c'tor of LayerData

Definition at line 515 of file NeuralNet.h.

◆ LayerData() [6/6]

TMVA::DNN::LayerData::LayerData ( LayerData &&  other)
inline

move c'tor of LayerData

Definition at line 538 of file NeuralNet.h.

Member Function Documentation

◆ activationFunction()

std::shared_ptr< std::function< double(double)> > TMVA::DNN::LayerData::activationFunction ( ) const
inline

Definition at line 607 of file NeuralNet.h.

◆ clear()

void TMVA::DNN::LayerData::clear ( )
inline

clear the values and the deltas

Definition at line 576 of file NeuralNet.h.

◆ clearDropOut()

void TMVA::DNN::LayerData::clearDropOut ( )
inline

clear the drop-out-data for this layer

Definition at line 620 of file NeuralNet.h.

◆ computeProbabilities()

LayerData::container_type TMVA::DNN::LayerData::computeProbabilities ( ) const
private

compute the probabilities from the node values

Definition at line 140 of file NeuralNet.cxx.

◆ deltasBegin() [1/2]

iterator_type TMVA::DNN::LayerData::deltasBegin ( )
inline

returns iterator to the begin of the deltas (back-propagation)

Definition at line 591 of file NeuralNet.h.

◆ deltasBegin() [2/2]

const_iterator_type TMVA::DNN::LayerData::deltasBegin ( ) const
inline

returns const iterator to the begin of the deltas (back-propagation)

Definition at line 594 of file NeuralNet.h.

◆ deltasEnd() [1/2]

iterator_type TMVA::DNN::LayerData::deltasEnd ( )
inline

returns iterator to the end of the deltas (back-propagation)

Definition at line 592 of file NeuralNet.h.

◆ deltasEnd() [2/2]

const_iterator_type TMVA::DNN::LayerData::deltasEnd ( ) const
inline

returns const iterator to the end of the deltas (back-propagation)

Definition at line 595 of file NeuralNet.h.

◆ dropOut()

const_dropout_iterator TMVA::DNN::LayerData::dropOut ( ) const
inline

return the begin of the drop-out information

Definition at line 623 of file NeuralNet.h.

◆ gradientsBegin() [1/2]

iterator_type TMVA::DNN::LayerData::gradientsBegin ( )
inline

returns iterator to the begin of the gradients

Definition at line 603 of file NeuralNet.h.

◆ gradientsBegin() [2/2]

const_iterator_type TMVA::DNN::LayerData::gradientsBegin ( ) const
inline

returns const iterator to the begin of the gradients

Definition at line 604 of file NeuralNet.h.

◆ hasDropOut()

bool TMVA::DNN::LayerData::hasDropOut ( ) const
inline

has this layer drop-out turned on?

Definition at line 622 of file NeuralNet.h.

◆ inverseActivationFunction()

std::shared_ptr< std::function< double(double)> > TMVA::DNN::LayerData::inverseActivationFunction ( ) const
inline

Definition at line 608 of file NeuralNet.h.

◆ outputMode()

ModeOutputValues TMVA::DNN::LayerData::outputMode ( ) const
inline

returns the output mode

Definition at line 588 of file NeuralNet.h.

◆ probabilities()

container_type TMVA::DNN::LayerData::probabilities ( ) const
inline

computes the probabilities from the current node values and returns them

Definition at line 589 of file NeuralNet.h.

◆ setDropOut()

template<typename Iterator >
void TMVA::DNN::LayerData::setDropOut ( Iterator  itDrop)
inline

set the drop-out info for this layer

Definition at line 614 of file NeuralNet.h.

◆ setInput()

void TMVA::DNN::LayerData::setInput ( const_iterator_type  itInputBegin,
const_iterator_type  itInputEnd 
)
inline

change the input iterators

Parameters
itInputBeginindicates the start of the input node vector
itInputEndindicates the end of the input node vector

Definition at line 565 of file NeuralNet.h.

◆ size()

size_t TMVA::DNN::LayerData::size ( ) const
inline

return the size of the layer

Definition at line 625 of file NeuralNet.h.

◆ valueGradientsBegin() [1/2]

iterator_type TMVA::DNN::LayerData::valueGradientsBegin ( )
inline

returns iterator to the begin of the gradients of the node values

Definition at line 597 of file NeuralNet.h.

◆ valueGradientsBegin() [2/2]

const_iterator_type TMVA::DNN::LayerData::valueGradientsBegin ( ) const
inline

returns const iterator to the begin of the gradients

Definition at line 600 of file NeuralNet.h.

◆ valueGradientsEnd() [1/2]

iterator_type TMVA::DNN::LayerData::valueGradientsEnd ( )
inline

returns iterator to the end of the gradients of the node values

Definition at line 598 of file NeuralNet.h.

◆ valueGradientsEnd() [2/2]

const_iterator_type TMVA::DNN::LayerData::valueGradientsEnd ( ) const
inline

returns const iterator to the end of the gradients

Definition at line 601 of file NeuralNet.h.

◆ valuesBegin() [1/2]

iterator_type TMVA::DNN::LayerData::valuesBegin ( )
inline

returns iterator to the begin of the (node) values

Definition at line 585 of file NeuralNet.h.

◆ valuesBegin() [2/2]

const_iterator_type TMVA::DNN::LayerData::valuesBegin ( ) const
inline

returns const iterator to the begin of the (node) values

Definition at line 582 of file NeuralNet.h.

◆ valuesEnd() [1/2]

iterator_type TMVA::DNN::LayerData::valuesEnd ( )
inline

returns iterator to the end of the (node) values

Definition at line 586 of file NeuralNet.h.

◆ valuesEnd() [2/2]

const_iterator_type TMVA::DNN::LayerData::valuesEnd ( ) const
inline

returns iterator to the end of the (node) values

Definition at line 583 of file NeuralNet.h.

◆ weightsBegin()

const_iterator_type TMVA::DNN::LayerData::weightsBegin ( ) const
inline

returns const iterator to the begin of the weights for this layer

Definition at line 605 of file NeuralNet.h.

Member Data Documentation

◆ m_activationFunction

std::shared_ptr<std::function<double(double)> > TMVA::DNN::LayerData::m_activationFunction
private

activation function for this layer

Definition at line 651 of file NeuralNet.h.

◆ m_deltas

std::vector<double> TMVA::DNN::LayerData::m_deltas
private

stores the deltas for the DNN training

Definition at line 642 of file NeuralNet.h.

◆ m_eModeOutput

ModeOutputValues TMVA::DNN::LayerData::m_eModeOutput
private

stores the output mode (DIRECT, SIGMOID, SOFTMAX)

Definition at line 658 of file NeuralNet.h.

◆ m_hasDropOut

bool TMVA::DNN::LayerData::m_hasDropOut
private

dropOut is turned on?

Definition at line 646 of file NeuralNet.h.

◆ m_hasGradients

bool TMVA::DNN::LayerData::m_hasGradients
private

does this layer have gradients (only if in training mode)

Definition at line 656 of file NeuralNet.h.

◆ m_hasWeights

bool TMVA::DNN::LayerData::m_hasWeights
private

does this layer have weights (it does not if it is the input layer)

Definition at line 655 of file NeuralNet.h.

◆ m_inverseActivationFunction

std::shared_ptr<std::function<double(double)> > TMVA::DNN::LayerData::m_inverseActivationFunction
private

inverse activation function for this layer

Definition at line 652 of file NeuralNet.h.

◆ m_isInputLayer

bool TMVA::DNN::LayerData::m_isInputLayer
private

is this layer an input layer

Definition at line 654 of file NeuralNet.h.

◆ m_itConstWeightBegin

const_iterator_type TMVA::DNN::LayerData::m_itConstWeightBegin
private

const iterator to the first weight of this layer in the weight vector

Definition at line 648 of file NeuralNet.h.

◆ m_itDropOut

const_dropout_iterator TMVA::DNN::LayerData::m_itDropOut
private

iterator to a container indicating if the corresponding node is to be dropped

Definition at line 645 of file NeuralNet.h.

◆ m_itGradientBegin

iterator_type TMVA::DNN::LayerData::m_itGradientBegin
private

iterator to the first gradient of this layer in the gradient vector

Definition at line 649 of file NeuralNet.h.

◆ m_itInputBegin

const_iterator_type TMVA::DNN::LayerData::m_itInputBegin
private

iterator to the first of the nodes in the input node vector

Definition at line 639 of file NeuralNet.h.

◆ m_itInputEnd

const_iterator_type TMVA::DNN::LayerData::m_itInputEnd
private

iterator to the end of the nodes in the input node vector

Definition at line 640 of file NeuralNet.h.

◆ m_size

size_t TMVA::DNN::LayerData::m_size
private

Definition at line 637 of file NeuralNet.h.

◆ m_valueGradients

std::vector<double> TMVA::DNN::LayerData::m_valueGradients
private

stores the gradients of the values (nodes)

Definition at line 643 of file NeuralNet.h.

◆ m_values

std::vector<double> TMVA::DNN::LayerData::m_values
private

stores the values of the nodes in this layer

Definition at line 644 of file NeuralNet.h.

Libraries for TMVA::DNN::LayerData:

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