diff --git a/src/mlpack/methods/ann/layer/base_layer.hpp b/src/mlpack/methods/ann/layer/base_layer.hpp index 6cc3be9fbe..648e0fee5d 100644 --- a/src/mlpack/methods/ann/layer/base_layer.hpp +++ b/src/mlpack/methods/ann/layer/base_layer.hpp @@ -11,6 +11,8 @@ #include #include #include +#include +#include namespace mlpack { namespace ann /** Artificial Neural Network. */ { @@ -23,6 +25,8 @@ namespace ann /** Artificial Neural Network. */ { * * - SigmoidLayer * - IdentityLayer + * - ReLULayer + * - TanHLayer * - BaseLayer2D * * @tparam ActivationFunction Activation function used for the embedding layer. @@ -165,6 +169,28 @@ template < using IdentityLayer = BaseLayer< ActivationFunction, InputDataType, OutputDataType>; +/** + * Standard rectified linear unit non-linearity layer. + */ +template < + class ActivationFunction = RectifierFunction, + typename InputDataType = arma::mat, + typename OutputDataType = arma::mat +> +using ReLULayer = BaseLayer< + ActivationFunction, InputDataType, OutputDataType>; + +/** + * Standard hyperbolic tangent layer. + */ +template < + class ActivationFunction = TanhFunction, + typename InputDataType = arma::mat, + typename OutputDataType = arma::mat +> +using TanHLayer = BaseLayer< + ActivationFunction, InputDataType, OutputDataType>; + /** * Standard Base-Layer2D using the logistic activation function. */