13 #ifndef MLPACK_METHODS_ANN_VISITOR_BACKWARD_VISITOR_HPP
14 #define MLPACK_METHODS_ANN_VISITOR_BACKWARD_VISITOR_HPP
19 #include <boost/variant.hpp>
34 const arma::mat& error,
39 const arma::mat& error,
44 template<
typename LayerType>
51 const arma::mat& input;
54 const arma::mat& error;
68 typename std::enable_if<
69 !HasRunCheck<T, bool&(T::*)(void)>::value,
void>::type
70 LayerBackward(T* layer, arma::mat& input)
const;
74 typename std::enable_if<
75 HasRunCheck<T, bool&(T::*)(void)>::value,
void>::type
76 LayerBackward(T* layer, arma::mat& input)
const;
83 #include "backward_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
BackwardVisitor executes the Backward() function given the input, error and delta parameter...
void operator()(LayerType *layer) const
Execute the Backward() function.
BackwardVisitor(const arma::mat &input, const arma::mat &error, arma::mat &delta)
Execute the Backward() function given the input, error and delta parameter.