12 #ifndef MLPACK_METHODS_ANN_LAYER_ADD_HPP 13 #define MLPACK_METHODS_ANN_LAYER_ADD_HPP 31 typename InputDataType = arma::mat,
32 typename OutputDataType = arma::mat
52 void Forward(
const arma::Mat<eT>&& input, arma::Mat<eT>&& output);
64 void Backward(
const arma::Mat<eT>&& ,
65 const arma::Mat<eT>&& gy,
76 void Gradient(
const arma::Mat<eT>&& ,
77 arma::Mat<eT>&& error,
108 template<
typename Archive>
109 void Serialize(Archive& ar,
const unsigned int );
135 #include "add_impl.hpp" void Serialize(Archive &ar, const unsigned int)
Serialize the layer.
Implementation of the Add module class.
InputDataType & InputParameter()
Modify the input parameter.
Linear algebra utility functions, generally performed on matrices or vectors.
InputDataType inputParameter
Locally-stored input parameter object.
The core includes that mlpack expects; standard C++ includes and Armadillo.
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 gradient
Locally-stored gradient object.
OutputDataType const & OutputParameter() const
Get the output parameter.
OutputDataType & OutputParameter()
Modify the output parameter.
OutputDataType & Gradient()
Modify the gradient.
OutputDataType & Parameters()
Modify the parameters.
OutputDataType const & Gradient() const
Get the gradient.
Add(const size_t outSize)
Create the Add object using the specified number of output units.
OutputDataType const & Parameters() const
Get the parameters.
size_t outSize
Locally-stored number of output units.
OutputDataType outputParameter
Locally-stored output parameter object.
void Forward(const arma::Mat< eT > &&input, arma::Mat< eT > &&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.
OutputDataType weights
Locally-stored weight object.
OutputDataType delta
Locally-stored delta object.
OutputDataType & Delta()
Modify the delta.
InputDataType const & InputParameter() const
Get the input parameter.