mlpack  master
load_output_parameter_visitor.hpp
Go to the documentation of this file.
1 
14 #ifndef MLPACK_METHODS_ANN_VISITOR_LOAD_OUTPUT_PARAMETER_VISITOR_HPP
15 #define MLPACK_METHODS_ANN_VISITOR_LOAD_OUTPUT_PARAMETER_VISITOR_HPP
16 
19 
20 #include <boost/variant.hpp>
21 
22 namespace mlpack {
23 namespace ann {
24 
29 class LoadOutputParameterVisitor : public boost::static_visitor<void>
30 {
31  public:
33  LoadOutputParameterVisitor(std::vector<arma::mat>&& parameter);
34 
36  template<typename LayerType>
37  void operator()(LayerType* layer) const;
38 
39  private:
41  std::vector<arma::mat>&& parameter;
42 
45  template<typename T>
46  typename std::enable_if<
47  !HasModelCheck<T, std::vector<LayerTypes>&(T::*)()>::value, void>::type
48  OutputParameter(T* layer) const;
49 
52  template<typename T>
53  typename std::enable_if<
54  HasModelCheck<T, std::vector<LayerTypes>&(T::*)()>::value, void>::type
55  OutputParameter(T* layer) const;
56 };
57 
58 } // namespace ann
59 } // namespace mlpack
60 
61 // Include implementation.
62 #include "load_output_parameter_visitor_impl.hpp"
63 
64 #endif
std::vector< arma::mat > && parameter
The parameter set.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: binarize.hpp:18
void operator()(LayerType *layer) const
Restore the output parameter.
std::enable_if< !HasModelCheck< T, std::vector< LayerTypes > &(T::*)()>::value, void >::type OutputParameter(T *layer) const
Restore the output parameter for a module which doesn&#39;t implement the Model() function.
LoadOutputParameterVisitor(std::vector< arma::mat > &&parameter)
Restore the output parameter given a parameter set.
LoadOutputParameterVisitor restores the output parameter using the given parameter set...