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  private:
39  std::vector<arma::mat>&& parameter;
40 
43  template<typename T>
44  typename std::enable_if<
45  !HasModelCheck<T>::value, void>::type
46  OutputParameter(T* layer) const;
47 
50  template<typename T>
51  typename std::enable_if<
52  HasModelCheck<T>::value, void>::type
53  OutputParameter(T* layer) const;
54 };
55 
56 } // namespace ann
57 } // namespace mlpack
58 
59 // Include implementation.
60 #include "save_output_parameter_visitor_impl.hpp"
61 
62 #endif
.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.