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

Private Member Functions

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

Private Attributes

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

#include <TMVA/NeuralNet.h>

Member Typedef Documentation

◆ const_dropout_iterator

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

Definition at line 449 of file NeuralNet.h.

◆ const_function_iterator_type

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

Definition at line 447 of file NeuralNet.h.

◆ const_iterator_type

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

Definition at line 443 of file NeuralNet.h.

◆ container_type

typedef std::vector<double> TMVA::DNN::LayerData::container_type

Definition at line 440 of file NeuralNet.h.

◆ function_container_type

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

Definition at line 445 of file NeuralNet.h.

◆ function_iterator_type

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

Definition at line 446 of file NeuralNet.h.

◆ iterator_type

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

Definition at line 442 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 472 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
itFunctionBeginindicates the start of the vector of activation functions for this layer on the activation function vector
itInverseFunctionBeginindicates the start of the vector of activation functions for this layer on the activation function vector
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
itFunctionBeginindicates the start of the vector of activation functions for this layer on the activation function vector
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 519 of file NeuralNet.h.

◆ LayerData() [6/6]

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

move c'tor of LayerData

Definition at line 542 of file NeuralNet.h.

Member Function Documentation

◆ activationFunction()

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

Definition at line 611 of file NeuralNet.h.

◆ clear()

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

clear the values and the deltas

Definition at line 580 of file NeuralNet.h.

◆ clearDropOut()

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

clear the drop-out-data for this layer

Definition at line 624 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 595 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 598 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 596 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 599 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 627 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 607 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 608 of file NeuralNet.h.

◆ hasDropOut()

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

has this layer drop-out turned on?

Definition at line 626 of file NeuralNet.h.

◆ inverseActivationFunction()

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

Definition at line 612 of file NeuralNet.h.

◆ outputMode()

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

returns the output mode

Definition at line 592 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 593 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 618 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 569 of file NeuralNet.h.

◆ size()

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

return the size of the layer

Definition at line 629 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 601 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 604 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 602 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 605 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 589 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 586 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 590 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 587 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 609 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 655 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 646 of file NeuralNet.h.

◆ m_eModeOutput

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

stores the output mode (DIRECT, SIGMOID, SOFTMAX)

Definition at line 662 of file NeuralNet.h.

◆ m_hasDropOut

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

dropOut is turned on?

Definition at line 650 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 660 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 659 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 656 of file NeuralNet.h.

◆ m_isInputLayer

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

is this layer an input layer

Definition at line 658 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 652 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 649 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 653 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 643 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 644 of file NeuralNet.h.

◆ m_size

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

Definition at line 641 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 647 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 648 of file NeuralNet.h.

Libraries for TMVA::DNN::LayerData:
[legend]

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