13 #ifndef MLPACK_METHODS_ANN_LAYER_BASE_LAYER_HPP 14 #define MLPACK_METHODS_ANN_LAYER_BASE_LAYER_HPP 43 class ActivationFunction = LogisticFunction,
44 typename InputDataType = arma::mat,
45 typename OutputDataType = arma::mat
65 template<
typename InputType,
typename OutputType>
66 void Forward(
const InputType&& input, OutputType&& output)
68 ActivationFunction::fn(input, output);
85 arma::Mat<eT> derivative;
86 ActivationFunction::deriv(input, derivative);
108 template<
typename Archive>
132 typename InputDataType = arma::mat,
133 typename OutputDataType = arma::mat
136 ActivationFunction, InputDataType, OutputDataType>;
143 typename InputDataType = arma::mat,
144 typename OutputDataType = arma::mat
147 ActivationFunction, InputDataType, OutputDataType>;
154 typename InputDataType = arma::mat,
155 typename OutputDataType = arma::mat
158 ActivationFunction, InputDataType, OutputDataType>;
165 typename InputDataType = arma::mat,
166 typename OutputDataType = arma::mat
169 ActivationFunction, InputDataType, OutputDataType>;
The identity function, defined by.
The tanh function, defined by.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
OutputDataType outputParameter
Locally-stored output parameter object.
OutputDataType const & OutputParameter() const
Get the output parameter.
InputDataType & InputParameter()
Modify the input parameter.
Implementation of the base layer.
OutputDataType delta
Locally-stored delta object.
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.
InputDataType inputParameter
Locally-stored input parameter object.
The logistic function, defined by.
BaseLayer()
Create the BaseLayer object.
InputDataType const & InputParameter() const
Get the input parameter.
void Serialize(Archive &, const unsigned int)
Serialize the layer.
OutputDataType & OutputParameter()
Modify the output parameter.
The rectifier function, defined by.
OutputDataType & Delta()
Modify the delta.
void Backward(const arma::Mat< eT > &&input, 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...