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.
82 #include "set_input_height_visitor_impl.hpp"
83 
84 #endif
bool operator()(LayerType *layer) const
Update the input height parameter.
SetInputHeightVisitor updates the input height parameter with the given input height.
Linear algebra utility functions, generally performed on matrices or vectors.
SetInputHeightVisitor(const size_t inputHeight=0, const bool reset=false)
Update the input height parameter with the given input height.
boost::variant< FlexibleReLU< arma::mat, arma::mat > *, Linear3D< arma::mat, arma::mat, NoRegularizer > *, LpPooling< arma::mat, arma::mat > *, PixelShuffle< arma::mat, arma::mat > *, ChannelShuffle< 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 > *, ReLU6< arma::mat, arma::mat > *, Reparametrization< arma::mat, arma::mat > *, Select< arma::mat, arma::mat > *, SpatialDropout< arma::mat, arma::mat > *, 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 > *, BicubicInterpolation< arma::mat, arma::mat > *, NearestInterpolation< arma::mat, arma::mat > *, GroupNorm< arma::mat, arma::mat > *> MoreTypes