[mlpack-git] master: Add convenience typedefs (ReLULayer, TanHLayer). (9d29ede)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Fri Nov 13 12:45:29 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/0f4e83dc9cc4dcdc315d2cceee32b23ebab114c2...7388de71d5398103ee3a0b32b4026902a40a67b3
>---------------------------------------------------------------
commit 9d29ede488692e032c8f676bf9c631e993f4f022
Author: marcus <marcus.edel at fu-berlin.de>
Date: Wed Oct 21 14:10:27 2015 +0200
Add convenience typedefs (ReLULayer, TanHLayer).
>---------------------------------------------------------------
9d29ede488692e032c8f676bf9c631e993f4f022
src/mlpack/methods/ann/layer/base_layer.hpp | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/src/mlpack/methods/ann/layer/base_layer.hpp b/src/mlpack/methods/ann/layer/base_layer.hpp
index 6cc3be9..648e0fe 100644
--- a/src/mlpack/methods/ann/layer/base_layer.hpp
+++ b/src/mlpack/methods/ann/layer/base_layer.hpp
@@ -11,6 +11,8 @@
#include <mlpack/core.hpp>
#include <mlpack/methods/ann/activation_functions/logistic_function.hpp>
#include <mlpack/methods/ann/activation_functions/identity_function.hpp>
+#include <mlpack/methods/ann/activation_functions/rectifier_function.hpp>
+#include <mlpack/methods/ann/activation_functions/tanh_function.hpp>
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.
@@ -166,6 +170,28 @@ 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.
*/
template <
More information about the mlpack-git
mailing list