save_output_parameter_visitor.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_METHODS_ANN_VISITOR_SAVE_OUTPUT_PARAMETER_VISITOR_HPP
14 #define MLPACK_METHODS_ANN_VISITOR_SAVE_OUTPUT_PARAMETER_VISITOR_HPP
15 
17 
18 #include <boost/variant.hpp>
19 
20 namespace mlpack {
21 namespace ann {
22 
27 class SaveOutputParameterVisitor : public boost::static_visitor<void>
28 {
29  public:
31  SaveOutputParameterVisitor(std::vector<arma::mat>&& parameter);
32 
34  template<typename LayerType>
35  void operator()(LayerType* layer) const;
36 
37  void operator()(MoreTypes layer) const;
38 
39  private:
41  std::vector<arma::mat>&& parameter;
42 
45  template<typename T>
46  typename std::enable_if<
47  !HasModelCheck<T>::value, void>::type
48  OutputParameter(T* layer) const;
49 
52  template<typename T>
53  typename std::enable_if<
54  HasModelCheck<T>::value, void>::type
55  OutputParameter(T* layer) const;
56 };
57 
58 } // namespace ann
59 } // namespace mlpack
60 
61 // Include implementation.
62 #include "save_output_parameter_visitor_impl.hpp"
63 
64 #endif
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
SaveOutputParameterVisitor saves the output parameter into the given parameter set.
void operator()(LayerType *layer) const
Save the output parameter.
SaveOutputParameterVisitor(std::vector< arma::mat > &&parameter)
Save the output parameter into the given parameter set.