diff --git a/src/mlpack/methods/ann/layer/log_softmax_layer.hpp b/src/mlpack/methods/ann/layer/log_softmax_layer.hpp index de911a19d3..46414c0faf 100644 --- a/src/mlpack/methods/ann/layer/log_softmax_layer.hpp +++ b/src/mlpack/methods/ann/layer/log_softmax_layer.hpp @@ -54,11 +54,11 @@ class LogSoftmaxLayer output.transform( [](double x) { //! Fast approximation of exp(-x) for x positive. - static const double A0 = 1.0; - static const double A1 = 0.125; - static const double A2 = 0.0078125; - static const double A3 = 0.00032552083; - static const double A4 = 1.0172526e-5; + constexpr double A0 = 1.0; + constexpr double A1 = 0.125; + constexpr double A2 = 0.0078125; + constexpr double A3 = 0.00032552083; + constexpr double A4 = 1.0172526e-5; if (x < 13.0) {