13 #ifndef MLPACK_METHODS_ANN_LAYER_BASE_LAYER_HPP 14 #define MLPACK_METHODS_ANN_LAYER_BASE_LAYER_HPP 45 class ActivationFunction = LogisticFunction,
46 typename InputDataType = arma::mat,
47 typename OutputDataType = arma::mat
67 template<
typename InputType,
typename OutputType>
68 void Forward(
const InputType&& input, OutputType&& output)
70 ActivationFunction::Fn(input, output);
87 arma::Mat<eT> derivative;
88 ActivationFunction::Deriv(input, derivative);
98 OutputDataType
const&
Delta()
const {
return delta; }
100 OutputDataType&
Delta() {
return delta; }
105 template<
typename Archive>
113 OutputDataType delta;
116 OutputDataType outputParameter;
126 typename InputDataType = arma::mat,
127 typename OutputDataType = arma::mat
130 ActivationFunction, InputDataType, OutputDataType>;
137 typename InputDataType = arma::mat,
138 typename OutputDataType = arma::mat
141 ActivationFunction, InputDataType, OutputDataType>;
148 typename InputDataType = arma::mat,
149 typename OutputDataType = arma::mat
152 ActivationFunction, InputDataType, OutputDataType>;
159 typename InputDataType = arma::mat,
160 typename OutputDataType = arma::mat
163 ActivationFunction, InputDataType, OutputDataType>;
170 typename InputDataType = arma::mat,
171 typename OutputDataType = arma::mat
174 ActivationFunction, InputDataType, OutputDataType>;
181 typename InputDataType = arma::mat,
182 typename OutputDataType = arma::mat
185 ActivationFunction, InputDataType, OutputDataType>;
The identity function, defined by.
OutputDataType & OutputParameter()
Modify the output parameter.
BaseLayer()
Create the BaseLayer object.
OutputDataType & Delta()
Modify the delta.
void serialize(Archive &, const unsigned int)
Serialize the layer.
The tanh function, defined by.
The core includes that mlpack expects; standard C++ includes and Armadillo.
OutputDataType const & OutputParameter() const
Get the output parameter.
OutputDataType const & Delta() const
Get the delta.
Implementation of the base layer.
The logistic function, defined by.
void Forward(const InputType &&input, OutputType &&output)
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activ...
The softplus function, defined by.
The hard sigmoid function, defined by.
The rectifier function, defined by.
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...