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  private:
39  size_t inputHeight;
40 
42  bool reset;
43 
46  template<typename T>
47  typename std::enable_if<
48  !HasInputHeight<T, size_t&(T::*)()>::value &&
49  !HasModelCheck<T>::value, bool>::type
50  LayerInputHeight(T* layer) const;
51 
54  template<typename T>
55  typename std::enable_if<
56  HasInputHeight<T, size_t&(T::*)()>::value &&
57  !HasModelCheck<T>::value, bool>::type
58  LayerInputHeight(T* layer) const;
59 
61  template<typename T>
62  typename std::enable_if<
63  !HasInputHeight<T, size_t&(T::*)()>::value &&
64  HasModelCheck<T>::value, bool>::type
65  LayerInputHeight(T* layer) const;
66 
69  template<typename T>
70  typename std::enable_if<
71  HasInputHeight<T, size_t&(T::*)()>::value &&
72  HasModelCheck<T>::value, bool>::type
73  LayerInputHeight(T* layer) const;
74 };
75 
76 } // namespace ann
77 } // namespace mlpack
78 
79 // Include implementation.
80 #include "set_input_height_visitor_impl.hpp"
81 
82 #endif
bool operator()(LayerType *layer) const
Update the input height parameter.
SetInputHeightVisitor updates the input height parameter with the given input height.
.hpp
Definition: add_to_po.hpp:21
SetInputHeightVisitor(const size_t inputHeight=0, const bool reset=false)
Update the input height parameter with the given input height.