mlpack 3.4.2
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
20namespace mlpack {
21namespace ann {
22
26class 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
ResetVisitor executes the Reset() function.
void operator()(LayerType *layer) const
Execute the Reset() function.
void operator()(MoreTypes layer) const
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
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1