mlpack 3.4.2
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
17namespace mlpack {
18namespace ann {
19
29template<
30 typename InputDataType = arma::mat,
31 typename OutputDataType = arma::mat
32>
33class Join
34{
35 public:
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 unsigned int /* 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
Implementation of the Join module class.
Definition: join.hpp:34
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 const & Delta() const
Get the delta.
Definition: join.hpp:69
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...
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: join.hpp:66
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
Join()
Create the Join object.
OutputDataType & Delta()
Modify the delta.
Definition: join.hpp:71
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.