From e1971f2b319423d3ff6658db87635698ae84392d Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Wed, 10 Jul 2024 01:42:42 +0200 Subject: [PATCH 01/18] Bump minimum Armadillo version to 10.8.2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16745cecb..3f21ce4c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,7 @@ if(USE_OPENMP) endif() # Find Armadillo and link it. -find_package(Armadillo 9.800.0 REQUIRED) +find_package(Armadillo 10.8.2 REQUIRED) target_link_libraries(ensmallen INTERFACE Armadillo::Armadillo) # Set helper variables for creating the version, config and target files. From a9f306484a703bf68d7fef2eaa49856571c93979 Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Wed, 10 Jul 2024 01:45:40 +0200 Subject: [PATCH 02/18] Bump minimum Armadillo version to 10.8 --- include/ensmallen.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ensmallen.hpp b/include/ensmallen.hpp index 72e6f248c..c8b49ec6e 100644 --- a/include/ensmallen.hpp +++ b/include/ensmallen.hpp @@ -34,8 +34,8 @@ #include -#if ((ARMA_VERSION_MAJOR < 9) || ((ARMA_VERSION_MAJOR == 9) && (ARMA_VERSION_MINOR < 800))) - #error "need Armadillo version 9.800 or later" +#if ((ARMA_VERSION_MAJOR < 10) || ((ARMA_VERSION_MAJOR == 10) && (ARMA_VERSION_MINOR < 8))) + #error "need Armadillo version 10.8 or newer" #endif #include From 770f11f2172651504c0bae0353fb33b6abb15d67 Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Wed, 10 Jul 2024 01:58:28 +0200 Subject: [PATCH 03/18] update HISTORY.md --- HISTORY.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index bd3726b5d..a3081bbff 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,6 +3,9 @@ * Update to C++14 standard ([#400](https://github.com/mlpack/ensmallen/pull/400)). + * Bump minimum Armadillo version to 10.8 + ([#404](https://github.com/mlpack/ensmallen/pull/404)). + ### ensmallen 2.21.1: "Bent Antenna" ###### 2024-02-15 * Fix numerical precision issues for small-gradient L-BFGS scaling factor From 32958a7fbd2be7dc3c1d76e331ace0ef35eb4e66 Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Thu, 11 Jul 2024 04:39:17 +0000 Subject: [PATCH 04/18] remove workaround for old versions of Armadillo --- .../ensmallen_bits/utility/arma_traits.hpp | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/include/ensmallen_bits/utility/arma_traits.hpp b/include/ensmallen_bits/utility/arma_traits.hpp index a2cc81e17..0555ea5eb 100644 --- a/include/ensmallen_bits/utility/arma_traits.hpp +++ b/include/ensmallen_bits/utility/arma_traits.hpp @@ -98,26 +98,17 @@ struct IsArmaType > const static bool value = true; }; +template +struct IsArmaType > +{ + const static bool value = true; +}; -#if ((ARMA_VERSION_MAJOR >= 10) || \ - ((ARMA_VERSION_MAJOR == 9) && (ARMA_VERSION_MINOR >= 869))) - - // Armadillo 9.869+ has SpSubview_col and SpSubview_row - - template - struct IsArmaType > - { - const static bool value = true; - }; - - template - struct IsArmaType > - { - const static bool value = true; - }; - -#endif - +template +struct IsArmaType > +{ + const static bool value = true; +}; // template<> template From c39b2f90d0a8560b9d81eb099a36f4a7843f883f Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Thu, 11 Jul 2024 04:40:17 +0000 Subject: [PATCH 05/18] remove workaround for old versions of Armadillo --- include/ensmallen_bits/function/arma_traits.hpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/ensmallen_bits/function/arma_traits.hpp b/include/ensmallen_bits/function/arma_traits.hpp index 5aff5f878..e13297b8e 100644 --- a/include/ensmallen_bits/function/arma_traits.hpp +++ b/include/ensmallen_bits/function/arma_traits.hpp @@ -77,11 +77,6 @@ struct MatTypeTraits> }; -#if ((ARMA_VERSION_MAJOR >= 10) || \ - ((ARMA_VERSION_MAJOR == 9) && (ARMA_VERSION_MINOR >= 869))) - -// Armadillo 9.869+ has SpSubview_col and SpSubview_row - template struct MatTypeTraits> { @@ -98,9 +93,6 @@ struct MatTypeTraits> "or a matrix alias instead!"); }; -#endif - - template struct MatTypeTraits> { From b2bb7a19d96067de414d74d8e4e7d25e363fb320 Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Thu, 11 Jul 2024 04:41:08 +0000 Subject: [PATCH 06/18] remove workaround for old versions of Armadillo --- tests/eve_test.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/eve_test.cpp b/tests/eve_test.cpp index 27f1b2f10..b357829cd 100644 --- a/tests/eve_test.cpp +++ b/tests/eve_test.cpp @@ -54,9 +54,6 @@ TEST_CASE("EveStyblinskiTangFunctionFMatTest","[EveTest]") FunctionTest(optimizer, 0.5, 0.1); } -#if ARMA_VERSION_MAJOR > 9 ||\ - (ARMA_VERSION_MAJOR == 9 && ARMA_VERSION_MINOR >= 400) - /** * Test the Eve optimizer on the Styblinski-Tang function, using arma::sp_mat as * the objective type. @@ -66,5 +63,3 @@ TEST_CASE("EveStyblinskiTangFunctionSpMatTest","[EveTest]") Eve optimizer(1e-3, 2, 0.9, 0.999, 0.999, 1e-8, 10000, 500000, 1e-9, true); FunctionTest(optimizer, 0.5, 0.1); } - -#endif From 015c44bfc25075e636afd3172f712a96159d8c3a Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Thu, 11 Jul 2024 04:41:50 +0000 Subject: [PATCH 07/18] remove workaround for old versions of Armadillo --- tests/snapshot_ensembles.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/snapshot_ensembles.cpp b/tests/snapshot_ensembles.cpp index ed07d2568..498d8c06b 100644 --- a/tests/snapshot_ensembles.cpp +++ b/tests/snapshot_ensembles.cpp @@ -85,9 +85,6 @@ TEST_CASE("SnapshotEnsemblesLogisticRegressionFMatTest","[SnapshotEnsemblesTest] } } -#if ARMA_VERSION_MAJOR > 9 ||\ - (ARMA_VERSION_MAJOR == 9 && ARMA_VERSION_MINOR >= 400) - /** * Run SGDR with snapshot ensembles on logistic regression and make sure the * results are acceptable. Use arma::sp_mat. @@ -102,5 +99,3 @@ TEST_CASE("SnapshotEnsemblesLogisticRegressionSpMatTest", LogisticRegressionFunctionTest(sgdr, 0.003, 0.006); } } - -#endif From dd1ff85707a7308e9ef4f11c2315376daa682017 Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Thu, 11 Jul 2024 04:42:30 +0000 Subject: [PATCH 08/18] remove workaround for old versions of Armadillo --- tests/bigbatch_sgd_test.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/bigbatch_sgd_test.cpp b/tests/bigbatch_sgd_test.cpp index d566a7add..f0978af17 100644 --- a/tests/bigbatch_sgd_test.cpp +++ b/tests/bigbatch_sgd_test.cpp @@ -72,9 +72,6 @@ TEST_CASE("BBSArmijoLogisticRegressionFMatTest", "[BigBatchSGDTest]") } } -#if ARMA_VERSION_MAJOR > 9 ||\ - (ARMA_VERSION_MAJOR == 9 && ARMA_VERSION_MINOR >= 400) - /** * Run big-batch SGD using BBS_BB on logistic regression and make sure the * results are acceptable. Use arma::sp_mat as the objective type. @@ -102,5 +99,3 @@ TEST_CASE("BBSArmijoLogisticRegressionSpMatTest", "[BigBatchSGDTest]") LogisticRegressionFunctionTest(bbsgd, 0.003, 0.006, 3); } } - -#endif From 54f755f71113b463eb01ea137457b66bdcee54b7 Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Thu, 11 Jul 2024 04:43:00 +0000 Subject: [PATCH 09/18] remove workaround for old versions of Armadillo --- tests/katyusha_test.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/katyusha_test.cpp b/tests/katyusha_test.cpp index eaebd250e..8ca61ea59 100644 --- a/tests/katyusha_test.cpp +++ b/tests/katyusha_test.cpp @@ -71,9 +71,6 @@ TEST_CASE("KatyushaProximalLogisticRegressionFMatTest", "[KatyushaTest]") } } -#if ARMA_VERSION_MAJOR > 9 ||\ - (ARMA_VERSION_MAJOR == 9 && ARMA_VERSION_MINOR >= 400) - /** * Run Katyusha on logistic regression and make sure the results are acceptable. * Use arma::sp_mat. @@ -101,5 +98,3 @@ TEST_CASE("KatyushaProximalLogisticRegressionSpMatTest", "[KatyushaTest]") LogisticRegressionFunctionTest(optimizer, 0.015, 0.015); } } - -#endif From 46443cc804cc9d0f7326e8033d19368f102b4e51 Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Thu, 11 Jul 2024 04:43:36 +0000 Subject: [PATCH 10/18] remove workaround for old versions of Armadillo --- tests/sarah_test.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/sarah_test.cpp b/tests/sarah_test.cpp index 14c6b7321..3877c27dc 100644 --- a/tests/sarah_test.cpp +++ b/tests/sarah_test.cpp @@ -72,9 +72,6 @@ TEST_CASE("SARAHPlusLogisticRegressionFMatTest","[SARAHTest]") } } -#if ARMA_VERSION_MAJOR > 9 ||\ - (ARMA_VERSION_MAJOR == 9 && ARMA_VERSION_MINOR >= 400) - /** * Run SARAH on logistic regression and make sure the results are * acceptable. Use arma::sp_mat. @@ -102,5 +99,3 @@ TEST_CASE("SARAHPlusLogisticRegressionSpMatTest","[SARAHTest]") LogisticRegressionFunctionTest(optimizer, 0.015, 0.015); } } - -#endif From 3ab90b37b899243788ade2795ae27401e3ab6dd9 Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Thu, 11 Jul 2024 04:44:07 +0000 Subject: [PATCH 11/18] remove workaround for old versions of Armadillo --- tests/svrg_test.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/svrg_test.cpp b/tests/svrg_test.cpp index 9a733f6fe..4b9f08888 100644 --- a/tests/svrg_test.cpp +++ b/tests/svrg_test.cpp @@ -72,9 +72,6 @@ TEST_CASE("SVRGBBLogisticRegressionFMatTest", "[SVRGTest]") } } -#if ARMA_VERSION_MAJOR > 9 ||\ - (ARMA_VERSION_MAJOR == 9 && ARMA_VERSION_MINOR >= 400) - /** * Run SVRG on logistic regression and make sure the results are acceptable. * Use arma::sp_mat. @@ -103,5 +100,3 @@ TEST_CASE("SVRGBBLogisticRegressionSpMatTest", "[SVRGTest]") LogisticRegressionFunctionTest(optimizer, 0.015, 0.015); } } - -#endif From 2b01c9d43b9bd14040b78042e16b9f76145e5f80 Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Thu, 11 Jul 2024 04:44:35 +0000 Subject: [PATCH 12/18] remove workaround for old versions of Armadillo --- tests/ada_bound_test.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/ada_bound_test.cpp b/tests/ada_bound_test.cpp index 64584a956..11c8ca9c8 100644 --- a/tests/ada_bound_test.cpp +++ b/tests/ada_bound_test.cpp @@ -55,9 +55,6 @@ TEST_CASE("AMSBoundphereFunctionTestFMat", "[AdaBoundTest]") FunctionTest(optimizer, 0.5, 0.1); } -#if ARMA_VERSION_MAJOR > 9 ||\ - (ARMA_VERSION_MAJOR == 9 && ARMA_VERSION_MINOR >= 400) - /** * Test the AdaBound optimizer on the Sphere function with arma::sp_mat. */ @@ -111,5 +108,3 @@ TEST_CASE("AMSBoundSphereFunctionTestSpMatDenseGradient", "[AdaBoundTest]") REQUIRE(coordinates(0) == Approx(0.0).margin(0.1)); REQUIRE(coordinates(1) == Approx(0.0).margin(0.1)); } - -#endif From 5f6a89e6f18f809c63a632478e9612b3d01dacd6 Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Thu, 11 Jul 2024 04:46:55 +0000 Subject: [PATCH 13/18] remove workaround for old versions of Armadillo --- tests/sgdr_test.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/sgdr_test.cpp b/tests/sgdr_test.cpp index d8e58aa90..7284d534b 100644 --- a/tests/sgdr_test.cpp +++ b/tests/sgdr_test.cpp @@ -81,9 +81,6 @@ TEST_CASE("SGDRLogisticRegressionFMatTest","[SGDRTest]") } } -#if ARMA_VERSION_MAJOR > 9 ||\ - (ARMA_VERSION_MAJOR == 9 && ARMA_VERSION_MINOR >= 400) - /** * Run SGDR on logistic regression and make sure the results are acceptable. * Use arma::sp_mat. @@ -97,5 +94,3 @@ TEST_CASE("SGDRLogisticRegressionSpMatTest","[SGDRTest]") LogisticRegressionFunctionTest(sgdr, 0.003, 0.006); } } - -#endif From 7d2dc1f7e66718742a3b0b59eff075b547a0421f Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Thu, 11 Jul 2024 04:47:28 +0000 Subject: [PATCH 14/18] remove workaround for old versions of Armadillo --- tests/swats_test.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/swats_test.cpp b/tests/swats_test.cpp index afae263cd..261bd7243 100644 --- a/tests/swats_test.cpp +++ b/tests/swats_test.cpp @@ -54,9 +54,6 @@ TEST_CASE("SWATSStyblinskiTangFunctionFMatTest", "[SWATSTest]") FunctionTest(optimizer, 3.0, 0.3); } -#if ARMA_VERSION_MAJOR > 9 ||\ - (ARMA_VERSION_MAJOR == 9 && ARMA_VERSION_MINOR >= 400) - /** * Test the SWATS optimizer on the Styblinski-Tang function. Use arma::sp_mat. */ @@ -65,5 +62,3 @@ TEST_CASE("SWATSStyblinskiTangFunctionSpMatTest", "[SWATSTest]") SWATS optimizer(1e-3, 2, 0.9, 0.999, 1e-6, 500000, 1e-9, true); FunctionTest(optimizer, 0.3, 0.03); } - -#endif From f8735180e03c3c25a6d8254084fa48b162803477 Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Thu, 11 Jul 2024 04:47:55 +0000 Subject: [PATCH 15/18] remove workaround for old versions of Armadillo --- tests/rmsprop_test.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/rmsprop_test.cpp b/tests/rmsprop_test.cpp index e2c6091bc..0d1c6dd8e 100644 --- a/tests/rmsprop_test.cpp +++ b/tests/rmsprop_test.cpp @@ -35,9 +35,6 @@ TEST_CASE("RMSPropLogisticRegressionFMatTest", "[rmsprop]") LogisticRegressionFunctionTest(optimizer, 0.003, 0.006); } -#if ARMA_VERSION_MAJOR > 9 ||\ - (ARMA_VERSION_MAJOR == 9 && ARMA_VERSION_MINOR >= 400) - /** * Run RMSProp on logistic regression and make sure the results are acceptable. * Use arma::sp_mat. @@ -47,5 +44,3 @@ TEST_CASE("RMSPropLogisticRegressionSpMatTest", "[rmsprop]") RMSProp optimizer; LogisticRegressionFunctionTest(optimizer, 0.003, 0.006); } - -#endif From 3ef869bf344e4888e09ba7b739258e4136ce7118 Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Thu, 11 Jul 2024 04:49:19 +0000 Subject: [PATCH 16/18] remove workaround for old versions of Armadillo --- tests/adam_test.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tests/adam_test.cpp b/tests/adam_test.cpp index 1a6dcda9f..f978fb0c3 100644 --- a/tests/adam_test.cpp +++ b/tests/adam_test.cpp @@ -38,9 +38,6 @@ TEST_CASE("AdamSphereFunctionTestFMat", "[AdamTest]") FunctionTest(optimizer, 0.5, 0.2); } -#if ARMA_VERSION_MAJOR > 9 ||\ - (ARMA_VERSION_MAJOR == 9 && ARMA_VERSION_MINOR >= 400) - /** * Test the AMSGrad optimizer on the Sphere function with arma::sp_mat. */ @@ -66,8 +63,6 @@ TEST_CASE("AdamSphereFunctionTestSpMatDenseGradient", "[AdamTest]") REQUIRE(coordinates(1) == Approx(0.0).margin(0.1)); } -#endif - /** * Test the Adam optimizer on the Wood function. */ @@ -123,9 +118,6 @@ TEST_CASE("AMSGradSphereFunctionTestFMat", "[AdamTest]") FunctionTest(optimizer, 0.5, 0.1); } -#if ARMA_VERSION_MAJOR > 9 || \ - (ARMA_VERSION_MAJOR == 9 && ARMA_VERSION_MINOR >= 400) - /** * Test the AMSGrad optimizer on the Sphere function with arma::sp_mat. */ @@ -151,8 +143,6 @@ TEST_CASE("AMSGradSphereFunctionTestSpMatDenseGradient", "[AdamTest]") REQUIRE(coordinates(1) == Approx(0.0).margin(0.1)); } -#endif - /** * Run Adam on logistic regression and make sure the results are acceptable. */ @@ -236,9 +226,6 @@ TEST_CASE("QHAdamLogisticRegressionFMatTest", "[AdamTest]") LogisticRegressionFunctionTest(optimizer, 0.03, 0.06); } -#if ARMA_VERSION_MAJOR > 9 ||\ - (ARMA_VERSION_MAJOR == 9 && ARMA_VERSION_MINOR >= 400) - /** * Run QHAdam on logistic regression and make sure the results are acceptable, * using arma::sp_mat. @@ -249,8 +236,6 @@ TEST_CASE("QHAdamLogisticRegressionSpMatTest", "[AdamTest]") LogisticRegressionFunctionTest(optimizer, 0.003, 0.006); } -#endif - /** * Test the Adam optimizer on the Ackley function. * This is to test the Ackley function and not Adam. From 32015aeef16e3ae8b7c6551f01229fb759ad4824 Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Fri, 12 Jul 2024 17:47:03 +0200 Subject: [PATCH 17/18] bump to armadillo 10.8.2 --- .appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 3dc36bb3c..6612dd378 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,5 +1,5 @@ environment: - ARMADILLO_DOWNLOAD: "https://sourceforge.net/projects/arma/files/armadillo-9.800.6.tar.xz" + ARMADILLO_DOWNLOAD: "https://sourceforge.net/projects/arma/files/armadillo-10.8.2.tar.xz" BLAS_LIBRARY: "%APPVEYOR_BUILD_FOLDER%/OpenBLAS.0.2.14.1/lib/native/lib/x64/libopenblas.dll.a" BLAS_LIBRARY_DLL: "%APPVEYOR_BUILD_FOLDER%/OpenBLAS.0.2.14.1/lib/native/lib/x64/libopenblas.dll" @@ -26,7 +26,7 @@ build_script: - cd .. - appveyor DownloadFile %ARMADILLO_DOWNLOAD% -FileName armadillo.tar.xz - 7z x armadillo.tar.xz -so -txz | 7z x -si -ttar > nul - - cd armadillo-9.800.6 && mkdir build && cd build + - cd armadillo-10.8.2 && mkdir build && cd build - > cmake -G "%VSVER%" -DBLAS_LIBRARY:FILEPATH=%BLAS_LIBRARY% @@ -43,7 +43,7 @@ build_script: - cd ensmallen && mkdir build && cd build - > cmake -G "%VSVER%" - -DARMADILLO_INCLUDE_DIR=%APPVEYOR_BUILD_FOLDER%/../armadillo-9.800.6/include/ + -DARMADILLO_INCLUDE_DIR=%APPVEYOR_BUILD_FOLDER%/../armadillo-10.8.2/include/ -DARMADILLO_LIBRARIES=%BLAS_LIBRARY% -DLAPACK_LIBRARY=%BLAS_LIBRARY% -DBLAS_LIBRARY=%BLAS_LIBRARY% From 51c950663cd84f0f8666b13d82f576d026d1f5d9 Mon Sep 17 00:00:00 2001 From: conradsnicta Date: Fri, 12 Jul 2024 17:48:55 +0200 Subject: [PATCH 18/18] bump to armadillo 10.8.2 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3eb9edbef..aa82655de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ script: - if [ $ARMADILLO == "latest" ]; then curl https://ftp.fau.de/macports/distfiles/armadillo/`curl https://ftp.fau.de/macports/distfiles/armadillo/ -- | grep '.tar.xz' | sed 's/^.*