mlpack  master
Public Member Functions | Private Member Functions | Private Attributes | List of all members
mlpack::ann::GradientSetVisitor Class Reference

GradientSetVisitor update the gradient parameter given the gradient set. More...

Inheritance diagram for mlpack::ann::GradientSetVisitor:
Inheritance graph
[legend]

Public Member Functions

 GradientSetVisitor (arma::mat &&gradient, size_t offset=0)
 Update the gradient parameter given the gradient set. More...
 
template<typename LayerType >
size_t operator() (LayerType *layer) const
 Update the gradient parameter. More...
 

Private Member Functions

template<typename T >
std::enable_if< HasGradientCheck< T, arma::mat &(T::*)()>::value &&!HasModelCheck< T, std::vector< LayerTypes > &(T::*)()>::value, size_t >::type LayerGradients (T *layer, arma::mat &input) const
 Update the gradient if the module implements the Gradient() function. More...
 
template<typename T >
std::enable_if< !HasGradientCheck< T, arma::mat &(T::*)()>::value &&HasModelCheck< T, std::vector< LayerTypes > &(T::*)()>::value, size_t >::type LayerGradients (T *layer, arma::mat &input) const
 Update the gradient if the module implements the Model() function. More...
 
template<typename T >
std::enable_if< HasGradientCheck< T, arma::mat &(T::*)()>::value &&HasModelCheck< T, std::vector< LayerTypes > &(T::*)()>::value, size_t >::type LayerGradients (T *layer, arma::mat &input) const
 Update the gradient if the module implements the Gradient() and Model() function. More...
 
template<typename T , typename P >
std::enable_if< !HasGradientCheck< T, P &(T::*)()>::value &&!HasModelCheck< T, std::vector< LayerTypes > &(T::*)()>::value, size_t >::type LayerGradients (T *layer, P &input) const
 Do not update the gradient parameter if the module doesn't implement the Gradient() or Model() function. More...
 

Private Attributes

arma::mat && gradient
 The gradient set. More...
 
size_t offset
 The gradient offset. More...
 

Detailed Description

GradientSetVisitor update the gradient parameter given the gradient set.

Definition at line 27 of file gradient_set_visitor.hpp.

Constructor & Destructor Documentation

mlpack::ann::GradientSetVisitor::GradientSetVisitor ( arma::mat &&  gradient,
size_t  offset = 0 
)

Update the gradient parameter given the gradient set.

Member Function Documentation

template<typename T >
std::enable_if< HasGradientCheck<T, arma::mat&(T::*)()>::value && !HasModelCheck<T, std::vector<LayerTypes>&(T::*)()>::value, size_t>::type mlpack::ann::GradientSetVisitor::LayerGradients ( T *  layer,
arma::mat &  input 
) const
private

Update the gradient if the module implements the Gradient() function.

template<typename T >
std::enable_if< !HasGradientCheck<T, arma::mat&(T::*)()>::value && HasModelCheck<T, std::vector<LayerTypes>&(T::*)()>::value, size_t>::type mlpack::ann::GradientSetVisitor::LayerGradients ( T *  layer,
arma::mat &  input 
) const
private

Update the gradient if the module implements the Model() function.

template<typename T >
std::enable_if< HasGradientCheck<T, arma::mat&(T::*)()>::value && HasModelCheck<T, std::vector<LayerTypes>&(T::*)()>::value, size_t>::type mlpack::ann::GradientSetVisitor::LayerGradients ( T *  layer,
arma::mat &  input 
) const
private

Update the gradient if the module implements the Gradient() and Model() function.

template<typename T , typename P >
std::enable_if< !HasGradientCheck<T, P&(T::*)()>::value && !HasModelCheck<T, std::vector<LayerTypes>&(T::*)()>::value, size_t>::type mlpack::ann::GradientSetVisitor::LayerGradients ( T *  layer,
P &  input 
) const
private

Do not update the gradient parameter if the module doesn't implement the Gradient() or Model() function.

template<typename LayerType >
size_t mlpack::ann::GradientSetVisitor::operator() ( LayerType *  layer) const

Update the gradient parameter.

Member Data Documentation

arma::mat&& mlpack::ann::GradientSetVisitor::gradient
private

The gradient set.

Definition at line 39 of file gradient_set_visitor.hpp.

size_t mlpack::ann::GradientSetVisitor::offset
private

The gradient offset.

Definition at line 42 of file gradient_set_visitor.hpp.


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