[mlpack-git] master: The transform() function isn't available on armadillo 3.6 so we move back to a standard for loop. (f2758b2)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Sat Aug 29 10:14:48 EDT 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/f601eaebcd70f940b3cc52b29802cbe6a88a7c37...f2758b220d426f52f0820426c89bceb1b1022532
>---------------------------------------------------------------
commit f2758b220d426f52f0820426c89bceb1b1022532
Author: Marcus Edel <marcus.edel at fu-berlin.de>
Date: Sat Aug 29 16:14:43 2015 +0200
The transform() function isn't available on armadillo 3.6 so we move back to a standard for loop.
>---------------------------------------------------------------
f2758b220d426f52f0820426c89bceb1b1022532
src/mlpack/methods/ann/activation_functions/softsign_function.hpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/mlpack/methods/ann/activation_functions/softsign_function.hpp b/src/mlpack/methods/ann/activation_functions/softsign_function.hpp
index 75f25b5..b535449 100644
--- a/src/mlpack/methods/ann/activation_functions/softsign_function.hpp
+++ b/src/mlpack/methods/ann/activation_functions/softsign_function.hpp
@@ -65,7 +65,9 @@ class SoftsignFunction
static void fn(const InputVecType& x, OutputVecType& y)
{
y = x;
- y.transform( [](double x) { return fn(x); } );
+
+ for (size_t i = 0; i < x.n_elem; i++)
+ y(i) = fn(x(i));
}
/**
More information about the mlpack-git
mailing list