13 #ifndef MLPACK_METHODS_ANN_VISITOR_GRADIENT_VISITOR_HPP 14 #define MLPACK_METHODS_ANN_VISITOR_GRADIENT_VISITOR_HPP 19 #include <boost/variant.hpp> 36 GradientVisitor(arma::mat&& input, arma::mat&& delta,
const size_t index);
39 template<
typename LayerType>
60 typename std::enable_if<
61 HasGradientCheck<T, arma::mat&(T::*)()>::value &&
62 !HasRunCheck<T, bool&(T::*)(void)>::value,
void>::type
63 LayerGradients(T* layer, arma::mat& input)
const;
68 typename std::enable_if<
69 HasGradientCheck<T, arma::mat&(T::*)()>::value &&
70 HasRunCheck<T, bool&(T::*)(void)>::value,
void>::type
71 LayerGradients(T* layer, arma::mat& input)
const;
75 template<
typename T,
typename P>
76 typename std::enable_if<
77 !HasGradientCheck<T, P&(T::*)()>::value,
void>::type
78 LayerGradients(T* layer, P& input)
const;
85 #include "gradient_visitor_impl.hpp" boost::variant< Recurrent< arma::mat, arma::mat > *, RecurrentAttention< arma::mat, arma::mat > *, ReinforceNormal< arma::mat, arma::mat > *, Reparametrization< arma::mat, arma::mat > *, Select< arma::mat, arma::mat > *, Sequential< arma::mat, arma::mat, false > *, Sequential< arma::mat, arma::mat, true > *, Subview< arma::mat, arma::mat > *, VRClassReward< arma::mat, arma::mat > *, VirtualBatchNorm< arma::mat, arma::mat > *> MoreTypes
SearchModeVisitor executes the Gradient() method of the given module using the input and delta parame...
void operator()(LayerType *layer) const
Executes the Gradient() method.
GradientVisitor(arma::mat &&input, arma::mat &&delta)
Executes the Gradient() method of the given module using the input and delta parameter.