Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t > Class Template Reference

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

Stochastic Batch Gradient Descent Optimizer class.

This class represents the Stochastic Batch Gradient Descent Optimizer with options for applying momentum and nesterov momentum.

Definition at line 46 of file SGD.h.

Public Types

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

Public Member Functions

 TSGD (Scalar_t learningRate, DeepNet_t &deepNet, Scalar_t momentum)
 Constructor.
 ~TSGD ()=default
 Destructor.
Scalar_t GetMomentum () const
 Getters.
std::vector< std::vector< Matrix_t > > & GetPastBiasGradients ()
std::vector< Matrix_t > & GetPastBiasGradientsAt (size_t i)
std::vector< std::vector< Matrix_t > > & GetPastWeightGradients ()
std::vector< Matrix_t > & GetPastWeightGradientsAt (size_t i)

Protected Member Functions

void UpdateBiases (size_t layerIndex, std::vector< Matrix_t > &biases, const std::vector< Matrix_t > &biasGradients) override
 Update the biases, given the current bias gradients.
void UpdateWeights (size_t layerIndex, std::vector< Matrix_t > &weights, const std::vector< Matrix_t > &weightGradients) override
 Update the weights, given the current weight gradients.

Protected Attributes

Scalar_t fMomentum
 The momentum used for training.
std::vector< std::vector< Matrix_t > > fPastBiasGradients
 The sum of the past bias gradients associated with the deep net.
std::vector< std::vector< Matrix_t > > fPastWeightGradients
 The sum of the past weight gradients associated with the deep net.

#include <TMVA/DNN/SGD.h>

Inheritance diagram for TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >:
VOptimizer< Architecture_t, VGeneralLayer< Architecture_t >, TDeepNet< Architecture_t, VGeneralLayer< Architecture_t > > >

Member Typedef Documentation

◆ Matrix_t

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

Definition at line 48 of file SGD.h.

◆ Scalar_t

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

Definition at line 49 of file SGD.h.

Constructor & Destructor Documentation

◆ TSGD()

template<typename Architecture_t, typename Layer_t, typename DeepNet_t>
TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >::TSGD ( Scalar_t learningRate,
DeepNet_t & deepNet,
Scalar_t momentum )

Constructor.

Definition at line 86 of file SGD.h.

◆ ~TSGD()

template<typename Architecture_t, typename Layer_t = VGeneralLayer<Architecture_t>, typename DeepNet_t = TDeepNet<Architecture_t, Layer_t>>
TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >::~TSGD ( )
default

Destructor.

Member Function Documentation

◆ GetMomentum()

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

Getters.

Definition at line 72 of file SGD.h.

◆ GetPastBiasGradients()

template<typename Architecture_t, typename Layer_t = VGeneralLayer<Architecture_t>, typename DeepNet_t = TDeepNet<Architecture_t, Layer_t>>
std::vector< std::vector< Matrix_t > > & TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >::GetPastBiasGradients ( )
inline

Definition at line 77 of file SGD.h.

◆ GetPastBiasGradientsAt()

template<typename Architecture_t, typename Layer_t = VGeneralLayer<Architecture_t>, typename DeepNet_t = TDeepNet<Architecture_t, Layer_t>>
std::vector< Matrix_t > & TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >::GetPastBiasGradientsAt ( size_t i)
inline

Definition at line 78 of file SGD.h.

◆ GetPastWeightGradients()

template<typename Architecture_t, typename Layer_t = VGeneralLayer<Architecture_t>, typename DeepNet_t = TDeepNet<Architecture_t, Layer_t>>
std::vector< std::vector< Matrix_t > > & TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >::GetPastWeightGradients ( )
inline

Definition at line 74 of file SGD.h.

◆ GetPastWeightGradientsAt()

template<typename Architecture_t, typename Layer_t = VGeneralLayer<Architecture_t>, typename DeepNet_t = TDeepNet<Architecture_t, Layer_t>>
std::vector< Matrix_t > & TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >::GetPastWeightGradientsAt ( size_t i)
inline

Definition at line 75 of file SGD.h.

◆ UpdateBiases()

template<typename Architecture_t, typename Layer_t, typename DeepNet_t>
auto TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >::UpdateBiases ( size_t layerIndex,
std::vector< Matrix_t > & biases,
const std::vector< Matrix_t > & biasGradients )
overrideprotected

Update the biases, given the current bias gradients.

Definition at line 136 of file SGD.h.

◆ UpdateWeights()

template<typename Architecture_t, typename Layer_t, typename DeepNet_t>
auto TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >::UpdateWeights ( size_t layerIndex,
std::vector< Matrix_t > & weights,
const std::vector< Matrix_t > & weightGradients )
overrideprotected

Update the weights, given the current weight gradients.

Definition at line 114 of file SGD.h.

Member Data Documentation

◆ fMomentum

template<typename Architecture_t, typename Layer_t = VGeneralLayer<Architecture_t>, typename DeepNet_t = TDeepNet<Architecture_t, Layer_t>>
Scalar_t TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >::fMomentum
protected

The momentum used for training.

Definition at line 52 of file SGD.h.

◆ fPastBiasGradients

template<typename Architecture_t, typename Layer_t = VGeneralLayer<Architecture_t>, typename DeepNet_t = TDeepNet<Architecture_t, Layer_t>>
std::vector<std::vector<Matrix_t> > TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >::fPastBiasGradients
protected

The sum of the past bias gradients associated with the deep net.

Definition at line 56 of file SGD.h.

◆ fPastWeightGradients

template<typename Architecture_t, typename Layer_t = VGeneralLayer<Architecture_t>, typename DeepNet_t = TDeepNet<Architecture_t, Layer_t>>
std::vector<std::vector<Matrix_t> > TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >::fPastWeightGradients
protected

The sum of the past weight gradients associated with the deep net.

Definition at line 54 of file SGD.h.


The documentation for this class was generated from the following file:
  • tmva/tmva/inc/TMVA/DNN/SGD.h