mlpack
forward_visitor_impl.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_METHODS_ANN_VISITOR_FORWARD_VISITOR_IMPL_HPP
13 #define MLPACK_METHODS_ANN_VISITOR_FORWARD_VISITOR_IMPL_HPP
14 
15 // In case it hasn't been included yet.
16 #include "forward_visitor.hpp"
17 
18 namespace mlpack {
19 namespace ann {
20 
22 inline ForwardVisitor::ForwardVisitor(const arma::mat& input, arma::mat& output) :
23  input(input),
24  output(output)
25 {
26  /* Nothing to do here. */
27 }
28 
29 template<typename LayerType>
30 inline void ForwardVisitor::operator()(LayerType* layer) const
31 {
32  layer->Forward(input, output);
33 }
34 
35 inline void ForwardVisitor::operator()(MoreTypes layer) const
36 {
37  layer.apply_visitor(*this);
38 }
39 
40 } // namespace ann
41 } // namespace mlpack
42 
43 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
ForwardVisitor(const arma::mat &input, arma::mat &output)
Execute the Forward() function given the input and output parameter.
Definition: forward_visitor_impl.hpp:22
void operator()(LayerType *layer) const
Execute the Forward() function.
Definition: forward_visitor_impl.hpp:30