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
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< FlexibleReLU< arma::mat, arma::mat > *, Linear3D< arma::mat, arma::mat, NoRegularizer > *, LpPooling< arma::mat, arma::mat > *, PixelShuffle< arma::mat, arma::mat > *, ChannelShuffle< arma::mat, arma::mat > *, 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 > *, ReLU6< arma::mat, arma::mat > *, Reparametrization< arma::mat, arma::mat > *, Select< arma::mat, arma::mat > *, SpatialDropout< arma::mat, arma::mat > *, 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 > *, ISRLU< arma::mat, arma::mat > *, BicubicInterpolation< arma::mat, arma::mat > *, NearestInterpolation< arma::mat, arma::mat > *, GroupNorm< arma::mat, arma::mat > *> MoreTypes