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
19 
20 namespace mlpack {
21 namespace ann {
22 
26 class ResetVisitor : public boost::static_visitor
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::value &&
41  !HasModelCheck::value, void>::type
42  ResetParameter(T* layer) const;
43 
46  template<typename T>
47  typename std::enable_if<
48  !HasResetCheck::value &&
49  HasModelCheck::value, void>::type
50  ResetParameter(T* layer) const;
51 
54  template<typename T>
55  typename std::enable_if<
56  HasResetCheck::value &&
57  HasModelCheck::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::value &&
65  !HasModelCheck::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
void operator()(LayerType *layer) const
Execute the Reset() function.
Linear algebra utility functions, generally performed on matrices or vectors.
ResetVisitor executes the Reset() function.
boost::variant< Linear3D< arma::mat, arma::mat, NoRegularizer > *, Glimpse< arma::mat, arma::mat > *, Highway< arma::mat, arma::mat > *, MultiheadAttention< arma::mat, arma::mat, NoRegularizer > *, 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 > *, RBF< arma::mat, arma::mat, GaussianFunction > *, BaseLayer< GaussianFunction, arma::mat, arma::mat > *, PositionalEncoding< arma::mat, arma::mat > *> MoreTypes