13 #ifndef MLPACK_METHODS_ANN_VISITOR_GRADIENT_ZERO_VISITOR_HPP 14 #define MLPACK_METHODS_ANN_VISITOR_GRADIENT_ZERO_VISITOR_HPP 19 #include <boost/variant.hpp> 34 template<
typename LayerType>
40 typename std::enable_if<
41 HasGradientCheck<T, arma::mat&(T::*)()>::value,
void>::type
42 LayerGradients(T* layer, arma::mat& input)
const;
46 template<
typename T,
typename P>
47 typename std::enable_if<
48 !HasGradientCheck<T, P&(T::*)()>::value,
void>::type
49 LayerGradients(T* layer, P& input)
const;
56 #include "gradient_zero_visitor_impl.hpp"
void operator()(LayerType *layer) const
Set the gradient to zero.
GradientZeroVisitor()
Set the gradient to zero for the given module.