reset_cell_visitor.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_METHODS_ANN_VISITOR_RESET_CELL_VISITOR_HPP
13 #define MLPACK_METHODS_ANN_VISITOR_RESET_CELL_VISITOR_HPP
14 
17 
18 #include <boost/variant.hpp>
19 
20 namespace mlpack {
21 namespace ann {
22 
26 class ResetCellVisitor : public boost::static_visitor<void>
27 {
28  public:
30  ResetCellVisitor(const size_t size);
31 
33  template<typename LayerType>
34  void operator()(LayerType* layer) const;
35 
36  void operator()(MoreTypes layer) const;
37 
38  private:
39  size_t size;
40 
43  template<typename T>
44  typename std::enable_if<
45  HasResetCellCheck<T, void(T::*)(const size_t)>::value, void>::type
46  ResetCell(T* layer) const;
47 
49  // the Reset() or Model() function.
50  template<typename T>
51  typename std::enable_if<
52  !HasResetCellCheck<T, void(T::*)(const size_t)>::value, void>::type
53  ResetCell(T* layer) const;
54 };
55 
56 } // namespace ann
57 } // namespace mlpack
58 
59 // Include implementation.
60 #include "reset_cell_visitor_impl.hpp"
61 
62 #endif
ResetCellVisitor executes the ResetCell() function.
Linear algebra utility functions, generally performed on matrices or vectors.
ResetCellVisitor(const size_t size)
Reset the cell using the given size.
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
void operator()(LayerType *layer) const
Execute the ResetCell() function.