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
46 template<
typename T,
typename P>
47 typename std::enable_if<
48 !HasGradientCheck<T, P&(T::*)()>::value,
void>::type
56 #include "gradient_zero_visitor_impl.hpp"
Linear algebra utility functions, generally performed on matrices or vectors.
std::enable_if< HasGradientCheck< T, arma::mat &(T::*)()>::value, void >::type LayerGradients(T *layer, arma::mat &input) const
Set the gradient to zero if the module implements the Gradient() function.
GradientZeroVisitor()
Set the gradient to zero for the given module.
void operator()(LayerType *layer) const
Set the gradient to zero.