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 
18 
19 #include <boost/variant.hpp>
20 
21 namespace mlpack {
22 namespace ann {
23 
27 class OutputHeightVisitor : public boost::static_visitor<size_t>
28 {
29  public:
31  template<typename LayerType>
32  size_t operator()(LayerType* layer) const;
33 
34  size_t operator()(MoreTypes layer) const;
35 
36  private:
39  template<typename T>
40  typename std::enable_if<
41  !HasInputHeight<T, size_t&(T::*)()>::value &&
42  !HasModelCheck<T>::value, size_t>::type
43  LayerOutputHeight(T* layer) const;
44 
47  template<typename T>
48  typename std::enable_if<
49  HasInputHeight<T, size_t&(T::*)()>::value &&
50  !HasModelCheck<T>::value, size_t>::type
51  LayerOutputHeight(T* layer) const;
52 
54  template<typename T>
55  typename std::enable_if<
56  !HasInputHeight<T, size_t&(T::*)()>::value &&
57  HasModelCheck<T>::value, size_t>::type
58  LayerOutputHeight(T* layer) const;
59 
62  template<typename T>
63  typename std::enable_if<
64  HasInputHeight<T, size_t&(T::*)()>::value &&
65  HasModelCheck<T>::value, size_t>::type
66  LayerOutputHeight(T* layer) const;
67 };
68 
69 } // namespace ann
70 } // namespace mlpack
71 
72 // Include implementation.
73 #include "output_height_visitor_impl.hpp"
74 
75 #endif
OutputHeightVisitor exposes the OutputHeight() method of the given module.
boost::variant< Linear3D< arma::mat, arma::mat, NoRegularizer > *, LpPooling< arma::mat, arma::mat > *, PixelShuffle< 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 > *, 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 > *, ISRLU< arma::mat, arma::mat > *> MoreTypes
Linear algebra utility functions, generally performed on matrices or vectors.
size_t operator()(LayerType *layer) const
Return the output height.