Apply suggestions from code review

Co-authored-by: kartikdutt18 <39593019+kartikdutt18@users.noreply.github.com>
This commit is contained in:
abh2k
2021-02-11 01:35:26 +05:30
committed by GitHub
co-authored by kartikdutt18
parent b0f6470767
commit f2284403df
+2 -2
View File
@@ -172,7 +172,7 @@ class LpPooling
arma::span(colidx, colidx + kernelHeight - 1 - offset));
output(i, j) = pow(arma::accu(arma::pow(subInput,
normType)), 1.0/normType);
normType)), 1.0 / normType);
}
}
}
@@ -199,7 +199,7 @@ class LpPooling
const arma::Mat<eT>& inputArea = input(arma::span(i, i + rStep - 1),
arma::span(j, j + cStep - 1));
size_t sum = pow(arma::accu(arma::pow(inputArea, normType)),
(normType-1) / normType);
(normType - 1) / normType);
unpooledError = arma::Mat<eT>(inputArea.n_rows, inputArea.n_cols);
unpooledError.fill(error(i / rStep, j / cStep));
unpooledError %= arma::pow(inputArea, normType - 1);