[mlpack-git] master: Handle 3rd tensors, when calculating the first derivatives of the identity function. (8fce908)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Sun May 10 07:33:22 EDT 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/f7c45b202a6265cc34f46f0ccc70c21cf4b51110...8fce9086d19a6cb228302f068920ce876035890c

>---------------------------------------------------------------

commit 8fce9086d19a6cb228302f068920ce876035890c
Author: Marcus Edel <marcus.edel at fu-berlin.de>
Date:   Sat May 9 21:12:16 2015 +0200

    Handle 3rd tensors, when calculating the first derivatives of the identity function.


>---------------------------------------------------------------

8fce9086d19a6cb228302f068920ce876035890c
 .../ann/activation_functions/identity_function.hpp        | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/mlpack/methods/ann/activation_functions/identity_function.hpp b/src/mlpack/methods/ann/activation_functions/identity_function.hpp
index 25dbd93..62f218a 100644
--- a/src/mlpack/methods/ann/activation_functions/identity_function.hpp
+++ b/src/mlpack/methods/ann/activation_functions/identity_function.hpp
@@ -68,6 +68,21 @@ class IdentityFunction
   {
     x.ones(y.n_elem);
   }
+
+  /**
+   * Computes the first derivatives of the identity function using a 3rd order
+   * tensor as input.
+   *
+   * @param y Input activations.
+   * @param x The resulting derivatives.
+   */
+  template<typename eT>
+  static void deriv(const arma::Cube<eT>& y, arma::Cube<eT>& x)
+  {
+    x.ones(y.n_rows, y.n_cols, y.n_slices);
+  }
+
+
 }; // class IdentityFunction
 
 }; // namespace ann



More information about the mlpack-git mailing list