reset_visitor.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_METHODS_ANN_VISITOR_RESET_VISITOR_HPP
14 #define MLPACK_METHODS_ANN_VISITOR_RESET_VISITOR_HPP
15 
17 
18 #include <boost/variant.hpp>
19 
20 namespace mlpack {
21 namespace ann {
22 
26 class ResetVisitor : public boost::static_visitor<void>
27 {
28  public:
30  template<typename LayerType>
31  void operator()(LayerType* layer) const;
32 
33  void operator()(MoreTypes layer) const;
34 
35  private:
38  template<typename T>
39  typename std::enable_if<
40  HasResetCheck<T, void(T::*)()>::value &&
41  !HasModelCheck<T>::value, void>::type
42  ResetParameter(T* layer) const;
43 
46  template<typename T>
47  typename std::enable_if<
48  !HasResetCheck<T, void(T::*)()>::value &&
49  HasModelCheck<T>::value, void>::type
50  ResetParameter(T* layer) const;
51 
54  template<typename T>
55  typename std::enable_if<
56  HasResetCheck<T, void(T::*)()>::value &&
57  HasModelCheck<T>::value, void>::type
58  ResetParameter(T* layer) const;
59 
61  // the Reset() or Model() function.
62  template<typename T>
63  typename std::enable_if<
64  !HasResetCheck<T, void(T::*)()>::value &&
65  !HasModelCheck<T>::value, void>::type
66  ResetParameter(T* layer) const;
67 };
68 
69 } // namespace ann
70 } // namespace mlpack
71 
72 // Include implementation.
73 #include "reset_visitor_impl.hpp"
74 
75 #endif
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
void operator()(LayerType *layer) const
Execute the Reset() function.
strip_type.hpp
Definition: add_to_po.hpp:21
ResetVisitor executes the Reset() function.