13 #ifndef MLPACK_METHODS_ANN_LAYER_LINEAR_HPP 14 #define MLPACK_METHODS_ANN_LAYER_LINEAR_HPP 33 typename InputDataType = arma::mat,
34 typename OutputDataType = arma::mat
63 void Forward(
const arma::Mat<eT>&& input, arma::Mat<eT>&& output);
75 void Backward(
const arma::Mat<eT>&& ,
87 void Gradient(
const arma::Mat<eT>&& input,
88 arma::Mat<eT>&& error,
119 template<
typename Archive>
120 void Serialize(Archive& ar,
const unsigned int );
155 #include "linear_impl.hpp" OutputDataType gradient
Locally-stored gradient object.
void Serialize(Archive &ar, const unsigned int)
Serialize the layer.
InputDataType const & InputParameter() const
Get the input parameter.
Linear algebra utility functions, generally performed on matrices or vectors.
OutputDataType & OutputParameter()
Modify the output parameter.
The core includes that mlpack expects; standard C++ includes and Armadillo.
OutputDataType weights
Locally-stored weight object.
OutputDataType const & Parameters() const
Get the parameters.
OutputDataType outputParameter
Locally-stored output parameter object.
OutputDataType & Gradient()
Modify the gradient.
OutputDataType weight
Locally-stored weight paramters.
InputDataType & InputParameter()
Modify the input parameter.
OutputDataType const & Delta() const
Get the delta.
OutputDataType & Delta()
Modify the delta.
InputDataType inputParameter
Locally-stored input parameter object.
OutputDataType bias
Locally-stored bias term parameters.
void Backward(const arma::Mat< eT > &&, 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 const & Gradient() const
Get the gradient.
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 & Parameters()
Modify the parameters.
size_t inSize
Locally-stored number of input units.
size_t outSize
Locally-stored number of output units.
OutputDataType delta
Locally-stored delta object.
Linear()
Create the Linear object.
OutputDataType const & OutputParameter() const
Get the output parameter.