Stochastic Batch Gradient Descent Optimizer class.
This class represents the Stochastic Batch Gradient Descent Optimizer with options for applying momentum and nesterov momentum.
Public Types | |
using | Matrix_t = typename Architecture_t::Matrix_t |
using | Scalar_t = typename Architecture_t::Scalar_t |
Public Types inherited from TMVA::DNN::VOptimizer< Architecture_t, Layer_t, DeepNet_t > | |
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) |
Public Member Functions inherited from TMVA::DNN::VOptimizer< Architecture_t, Layer_t, DeepNet_t > | |
VOptimizer (Scalar_t learningRate, DeepNet_t &deepNet) | |
Constructor. | |
virtual | ~VOptimizer ()=default |
Virtual Destructor. | |
size_t | GetGlobalStep () const |
Layer_t * | GetLayerAt (size_t i) |
std::vector< Layer_t * > & | GetLayers () |
Scalar_t | GetLearningRate () const |
Getters. | |
void | IncrementGlobalStep () |
Increments the global step. | |
void | SetLearningRate (size_t learningRate) |
Setters. | |
void | Step () |
Performs one step of optimization. | |
Protected Member Functions | |
void | UpdateBiases (size_t layerIndex, std::vector< Matrix_t > &biases, const std::vector< Matrix_t > &biasGradients) |
Update the biases, given the current bias gradients. | |
void | UpdateWeights (size_t layerIndex, std::vector< Matrix_t > &weights, const std::vector< Matrix_t > &weightGradients) |
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. | |
Protected Attributes inherited from TMVA::DNN::VOptimizer< Architecture_t, Layer_t, DeepNet_t > | |
DeepNet_t & | fDeepNet |
The reference to the deep net. | |
size_t | fGlobalStep |
The current global step count during training. | |
Scalar_t | fLearningRate |
The learning rate used for training. | |
#include <TMVA/DNN/SGD.h>
using TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >::Matrix_t = typename Architecture_t::Matrix_t |
using TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >::Scalar_t = typename Architecture_t::Scalar_t |
TMVA::DNN::TSGD< Architecture_t, Layer_t, DeepNet_t >::TSGD | ( | Scalar_t | learningRate, |
DeepNet_t & | deepNet, | ||
Scalar_t | momentum | ||
) |
|
default |
Destructor.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protectedvirtual |
Update the biases, given the current bias gradients.
Implements TMVA::DNN::VOptimizer< Architecture_t, Layer_t, DeepNet_t >.
|
protectedvirtual |
Update the weights, given the current weight gradients.
Implements TMVA::DNN::VOptimizer< Architecture_t, Layer_t, DeepNet_t >.
|
protected |
|
protected |
|
protected |