mlpack 3.4.2
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
20namespace mlpack {
21namespace ann {
22
27class 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
SetInputHeightVisitor updates the input height parameter with the given input height.
bool operator()(MoreTypes layer) const
SetInputHeightVisitor(const size_t inputHeight=0, const bool reset=false)
Update the input height parameter with the given input height.
bool operator()(LayerType *layer) const
Update the input height parameter.
boost::variant< Linear3D< arma::mat, arma::mat, NoRegularizer > *, 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 > * > MoreTypes
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1