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.
boost::variant< 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 > *> MoreTypes
strip_type.hpp
Definition: add_to_po.hpp:21
ResetCellVisitor(const size_t size)
Reset the cell using the given size.
void operator()(LayerType *layer) const
Execute the ResetCell() function.