join.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_METHODS_ANN_LAYER_JOIN_HPP
13 #define MLPACK_METHODS_ANN_LAYER_JOIN_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace ann {
19 
29 template<
30  typename InputDataType = arma::mat,
31  typename OutputDataType = arma::mat
32 >
33 class Join
34 {
35  public:
37  Join();
38 
46  template<typename InputType, typename OutputType>
47  void Forward(const InputType& input, OutputType& output);
48 
58  template<typename eT>
59  void Backward(const arma::Mat<eT>& /* input */,
60  const arma::Mat<eT>& gy,
61  arma::Mat<eT>& g);
62 
64  OutputDataType const& OutputParameter() const { return outputParameter; }
66  OutputDataType& OutputParameter() { return outputParameter; }
67 
69  OutputDataType const& Delta() const { return delta; }
71  OutputDataType& Delta() { return delta; }
72 
76  template<typename Archive>
77  void serialize(Archive& ar, const uint32_t /* version */);
78 
79  private:
81  size_t inSizeRows;
82 
84  size_t inSizeCols;
85 
87  OutputDataType delta;
88 
90  OutputDataType outputParameter;
91 }; // class Join
92 
93 } // namespace ann
94 } // namespace mlpack
95 
96 // Include implementation.
97 #include "join_impl.hpp"
98 
99 #endif
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: join.hpp:66
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Implementation of the Join module class.
Definition: join.hpp:33
OutputDataType const & Delta() const
Get the delta.
Definition: join.hpp:69
Join()
Create the Join object.
OutputDataType const & OutputParameter() const
Get the output parameter.
Definition: join.hpp:64
void Backward(const arma::Mat< eT > &, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backw...
void Forward(const InputType &input, OutputType &output)
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activ...
OutputDataType & Delta()
Modify the delta.
Definition: join.hpp:71