From 83207c4439ce3072e9b590cd6d2feeafdd25f2bd Mon Sep 17 00:00:00 2001 From: abh2k <41710346+abh2k@users.noreply.github.com> Date: Mon, 21 Jun 2021 12:10:20 +0530 Subject: [PATCH] Use arma::pow to use fast armadillo computation --- src/mlpack/methods/ann/layer/lp_pooling.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mlpack/methods/ann/layer/lp_pooling.hpp b/src/mlpack/methods/ann/layer/lp_pooling.hpp index 7af72e00bf..b87c496004 100644 --- a/src/mlpack/methods/ann/layer/lp_pooling.hpp +++ b/src/mlpack/methods/ann/layer/lp_pooling.hpp @@ -195,9 +195,10 @@ class LpPooling if (colidx >= 1) val -= inputPre(rowEnd, colidx - 1); - output(i, j) = pow(val, 1.0 / normType); + output(i, j) = val; } } + output = arma::pow(output, 1.0 / normType); } /**