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);
100 const arma::Mat<eT>& gy,
103 arma::Mat<eT> 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;
141 class ActivationFunction = LogisticFunction,
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>;