mlpack  master
output_height_visitor.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_METHODS_ANN_VISITOR_OUTPUT_HEIGHT_VISITOR_HPP
15 #define MLPACK_METHODS_ANN_VISITOR_OUTPUT_HEIGHT_VISITOR_HPP
16 
19 
20 #include <boost/variant.hpp>
21 
22 namespace mlpack {
23 namespace ann {
24 
28 class OutputHeightVisitor : public boost::static_visitor<size_t>
29 {
30  public:
32  template<typename LayerType>
33  size_t operator()(LayerType* layer) const;
34 
35  private:
38  template<typename T>
39  typename std::enable_if<
40  !HasInputHeight<T, size_t&(T::*)()>::value &&
41  !HasModelCheck<T, std::vector<LayerTypes>&(T::*)()>::value, size_t>::type
42  LayerOutputHeight(T* layer) const;
43 
46  template<typename T>
47  typename std::enable_if<
48  HasInputHeight<T, size_t&(T::*)()>::value &&
49  !HasModelCheck<T, std::vector<LayerTypes>&(T::*)()>::value, size_t>::type
50  LayerOutputHeight(T* layer) const;
51 
53  template<typename T>
54  typename std::enable_if<
55  !HasInputHeight<T, size_t&(T::*)()>::value &&
56  HasModelCheck<T, std::vector<LayerTypes>&(T::*)()>::value, size_t>::type
57  LayerOutputHeight(T* layer) const;
58 
61  template<typename T>
62  typename std::enable_if<
63  HasInputHeight<T, size_t&(T::*)()>::value &&
64  HasModelCheck<T, std::vector<LayerTypes>&(T::*)()>::value, size_t>::type
65  LayerOutputHeight(T* layer) const;
66 };
67 
68 } // namespace ann
69 } // namespace mlpack
70 
71 // Include implementation.
72 #include "output_height_visitor_impl.hpp"
73 
74 #endif
OutputWidthVisitor exposes the OutputHeight() method of the given module.
size_t operator()(LayerType *layer) const
Return the output height.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: binarize.hpp:18
std::enable_if< !HasInputHeight< T, size_t &(T::*)()>::value &&!HasModelCheck< T, std::vector< LayerTypes > &(T::*)()>::value, size_t >::type LayerOutputHeight(T *layer) const
Return 0 if the module doesn&#39;t implement the InputHeight() or Model() function.