diff --git a/src/mlpack/methods/ann/layer/elu.hpp b/src/mlpack/methods/ann/layer/elu.hpp index 1bc91a675e..d586514217 100644 --- a/src/mlpack/methods/ann/layer/elu.hpp +++ b/src/mlpack/methods/ann/layer/elu.hpp @@ -254,6 +254,7 @@ class ELU //! inputs. double lambda; }; // class ELU +// Template alias for SELU using ELU class using SELU = ELU; } // namespace ann diff --git a/src/mlpack/tests/activation_functions_test.cpp b/src/mlpack/tests/activation_functions_test.cpp index 43f937aa44..cc2e6ccce1 100644 --- a/src/mlpack/tests/activation_functions_test.cpp +++ b/src/mlpack/tests/activation_functions_test.cpp @@ -388,14 +388,14 @@ BOOST_AUTO_TEST_CASE(SELUFunctionDerivativeTest) selu.Backward(std::move(input), std::move(error), std::move(derivatives)); BOOST_REQUIRE_LE(arma::as_scalar(arma::abs(arma::mean(derivatives) - - selu.Lambda())), 10e-5); + selu.Lambda())), 10e-4); input.fill(-1); selu.Backward(std::move(input), std::move(error), std::move(derivatives)); BOOST_REQUIRE_LE(arma::as_scalar(arma::abs(arma::mean(derivatives) - - selu.Lambda()*(selu.Alpha()-1))), 10e-5); + selu.Lambda() * (selu.Alpha() - 1))), 10e-4); } /**