13 #ifndef MLPACK_METHODS_ANN_LAYER_BASE_LAYER_HPP 14 #define MLPACK_METHODS_ANN_LAYER_BASE_LAYER_HPP 61 class ActivationFunction = LogisticFunction,
62 typename InputDataType = arma::mat,
63 typename OutputDataType = arma::mat
83 template<
typename InputType,
typename OutputType>
84 void Forward(
const InputType& input, OutputType& output)
86 ActivationFunction::Fn(input, output);
103 arma::Mat
derivative; 104 ActivationFunction::Deriv(input, derivative);
114 OutputDataType
const&
Delta()
const {
return delta; }
116 OutputDataType&
Delta() {
return delta; }
121 template<
typename Archive>
129 OutputDataType delta;
132 OutputDataType outputParameter;
142 typename InputDataType = arma::mat,
143 typename OutputDataType = arma::mat
146 ActivationFunction, InputDataType, OutputDataType>;
153 typename InputDataType = arma::mat,
154 typename OutputDataType = arma::mat
157 ActivationFunction, InputDataType, OutputDataType>;
164 typename InputDataType = arma::mat,
165 typename OutputDataType = arma::mat
168 ActivationFunction, InputDataType, OutputDataType>;
175 typename InputDataType = arma::mat,
176 typename OutputDataType = arma::mat
179 ActivationFunction, InputDataType, OutputDataType>;
186 typename InputDataType = arma::mat,
187 typename OutputDataType = arma::mat
190 ActivationFunction, InputDataType, OutputDataType>;
197 typename InputDataType = arma::mat,
198 typename OutputDataType = arma::mat
201 ActivationFunction, InputDataType, OutputDataType>;
208 typename InputDataType = arma::mat,
209 typename OutputDataType = arma::mat
212 ActivationFunction, InputDataType, OutputDataType>;
219 typename InputDataType = arma::mat,
220 typename OutputDataType = arma::mat
223 ActivationFunction, InputDataType, OutputDataType>;
230 typename InputDataType = arma::mat,
231 typename OutputDataType = arma::mat
234 ActivationFunction, InputDataType, OutputDataType>;
241 typename InputDataType = arma::mat,
242 typename OutputDataType = arma::mat
245 ActivationFunction, InputDataType, OutputDataType>;
252 typename InputDataType = arma::mat,
253 typename OutputDataType = arma::mat
256 ActivationFunction, InputDataType, OutputDataType>;
263 typename InputDataType = arma::mat,
264 typename OutputDataType = arma::mat
267 ActivationFunction, InputDataType, OutputDataType>;
274 typename InputDataType = arma::mat,
275 typename OutputDataType = arma::mat
278 ActivationFunction, InputDataType, OutputDataType>;
The identity 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...
OutputDataType & OutputParameter()
Modify the output parameter.
BaseLayer()
Create the BaseLayer object.
The LiSHT function, defined by.
OutputDataType & Delta()
Modify the delta.
void Backward(const arma::Mat< eT > &input, 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...
void serialize(Archive &, const unsigned int)
Serialize the layer.
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.
The ELiSH function, defined by.
OutputDataType const & OutputParameter() const
Get the output parameter.
OutputDataType const & Delta() const
Get the delta.
Implementation of the base layer.
The Mish function, defined by.
The logistic function, defined by.
The gaussian function, defined by.
The Elliot function, defined by.
The swish function, defined by.
The softplus function, defined by.
The hard sigmoid function, defined by.
The GELU function, defined by.
The rectifier function, defined by.