From 4f724a59a2d64f2c2ce4690dc8d951460ae4b6f4 Mon Sep 17 00:00:00 2001 From: manthan-r-sheth Date: Tue, 3 Apr 2018 10:18:37 +0530 Subject: [PATCH] Fix style errors --- src/mlpack/methods/ann/layer/flexible_relu_impl.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mlpack/methods/ann/layer/flexible_relu_impl.hpp b/src/mlpack/methods/ann/layer/flexible_relu_impl.hpp index c2b52d61cb..25ce8faf83 100644 --- a/src/mlpack/methods/ann/layer/flexible_relu_impl.hpp +++ b/src/mlpack/methods/ann/layer/flexible_relu_impl.hpp @@ -45,9 +45,8 @@ void FlexibleReLU::Forward( { int i = -1; output = arma::zeros(input.n_rows, input.n_cols); - output.transform( [input, &i](double val) { ++i; + output.transform([input, &i](double val) { ++i; return (std::max(input(i), 0.0) + alpha); } ); - } template @@ -59,7 +58,7 @@ void FlexibleReLU::Backward( //! Compute the first derivative of FlexibleReLU function. derivative.set_size(input.n_rows, input.n_cols); int i = -1; - derivative.transform( [input, &i](double val) { ++i; + derivative.transform([input, &i](double val) { ++i; return (input(i) > 0? 1 : 0); } ); g = gy % derivative;