mlpack
set_input_height_visitor.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_METHODS_ANN_VISITOR_SET_INPUT_HEIGHT_VISITOR_HPP
14 #define MLPACK_METHODS_ANN_VISITOR_SET_INPUT_HEIGHT_VISITOR_HPP
15 
17 
18 #include <boost/variant.hpp>
19 
20 namespace mlpack {
21 namespace ann {
22 
27 class SetInputHeightVisitor : public boost::static_visitor<bool>
28 {
29  public:
31  SetInputHeightVisitor(const size_t inputHeight = 0, const bool reset = false);
32 
34  template<typename LayerType>
35  bool operator()(LayerType* layer) const;
36 
37  bool operator()(MoreTypes layer) const;
38 
39  private:
41  size_t inputHeight;
42 
44  bool reset;
45 
48  template<typename T>
49  typename std::enable_if<
50  !HasInputHeight<T, size_t&(T::*)()>::value &&
51  !HasModelCheck<T>::value, bool>::type
52  LayerInputHeight(T* layer) const;
53 
56  template<typename T>
57  typename std::enable_if<
58  HasInputHeight<T, size_t&(T::*)()>::value &&
59  !HasModelCheck<T>::value, bool>::type
60  LayerInputHeight(T* layer) const;
61 
63  template<typename T>
64  typename std::enable_if<
65  !HasInputHeight<T, size_t&(T::*)()>::value &&
66  HasModelCheck<T>::value, bool>::type
67  LayerInputHeight(T* layer) const;
68 
71  template<typename T>
72  typename std::enable_if<
73  HasInputHeight<T, size_t&(T::*)()>::value &&
74  HasModelCheck<T>::value, bool>::type
75  LayerInputHeight(T* layer) const;
76 };
77 
78 } // namespace ann
79 } // namespace mlpack
80 
81 // Include implementation.
83 
84 #endif
SetInputHeightVisitor updates the input height parameter with the given input height.
Definition: set_input_height_visitor.hpp:27
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
bool operator()(LayerType *layer) const
Update the input height parameter.
Definition: set_input_height_visitor_impl.hpp:31
SetInputHeightVisitor(const size_t inputHeight=0, const bool reset=false)
Update the input height parameter with the given input height.
Definition: set_input_height_visitor_impl.hpp:22