Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c978835
Normalize step size to the batch size used.
rcurtin Aug 27, 2025
13dafcf
Update history.
rcurtin Aug 27, 2025
5bb09e9
Don't use if constexpr.
rcurtin Sep 2, 2025
d6dc9c5
Merge remote-tracking branch 'origin/master' into batch-size-step
rcurtin Sep 2, 2025
e3b6097
Merge remote-tracking branch 'origin/master' into batch-size-step
rcurtin Sep 3, 2025
a22a8d1
Fix all step sizes in tests to account for new behavior.
rcurtin Sep 3, 2025
554191c
Retune DemonSGD tests to reduce failure probability.
rcurtin Sep 4, 2025
4c791d2
Merge remote-tracking branch 'origin/master' into batch-size-step
rcurtin Sep 7, 2025
f1f75df
Merge Bandicoot tests into existing TEMPLATE_TEST_CASEs.
rcurtin Sep 7, 2025
916b528
Fix merge artifact.
rcurtin Sep 7, 2025
dca2a83
Fix compilation errors.
rcurtin Sep 7, 2025
205a2b6
Fix MOEAD test to be more robust.
rcurtin Sep 8, 2025
392b0c3
Merge branch 'batch-size-step' into merge-coot-tests
rcurtin Sep 8, 2025
a021834
Merge remote-tracking branch 'origin/master' into merge-coot-tests
rcurtin Sep 9, 2025
db93931
Oops, fix missing colon.
rcurtin Sep 9, 2025
02317f2
Fix compilation issues.
rcurtin Sep 11, 2025
74cd4e5
Remove arma:: for randu call.
rcurtin Sep 14, 2025
fda1ce0
Try to fix AppVeyor build.
rcurtin Sep 12, 2025
8859f04
Bump version number to fix mlpack integration build.
rcurtin Sep 14, 2025
f40df09
Merge branch 'master' into merge-coot-tests
rcurtin Sep 16, 2025
7fcc3d2
Merge remote-tracking branch 'origin/master' into merge-coot-tests
rcurtin Sep 18, 2025
4c2e234
Adapt FBS/FISTA/FASTA to bandicoot tests.
rcurtin Sep 18, 2025
9ace594
Keep bandicoot implementation separate.
rcurtin Sep 18, 2025
3226312
Print which tests take a long time so I can prune down the runtime.
rcurtin Sep 19, 2025
cd2ab8d
Remove some tests that take a long long time.
rcurtin Sep 19, 2025
4e19b9f
Filter out some more long-running GPU tests.
rcurtin Sep 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ build_script:
-DLAPACK_LIBRARY:FILEPATH=%BLAS_LIBRARY%
-DCMAKE_PREFIX:FILEPATH="%APPVEYOR_BUILD_FOLDER%/armadillo"
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_BUILD_TYPE=Release ..
- >
"%MSBUILD%" "armadillo.sln"
Expand All @@ -47,6 +48,7 @@ build_script:
-DARMADILLO_LIBRARIES=%BLAS_LIBRARY%
-DLAPACK_LIBRARY=%BLAS_LIBRARY%
-DBLAS_LIBRARY=%BLAS_LIBRARY%
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_BUILD_TYPE=Release ..
- >
"%MSBUILD%" "ensmallen.sln"
Expand Down
8 changes: 4 additions & 4 deletions include/ensmallen_bits/ens_version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@

// This follows the Semantic Versioning pattern defined in https://semver.org/.

#define ENS_VERSION_MAJOR 2
#define ENS_VERSION_MAJOR 3
// The minor version is two digits so regular numerical comparisons of versions
// work right. The first minor version of a release is always 10.
#define ENS_VERSION_MINOR 22
#define ENS_VERSION_PATCH 2
#define ENS_VERSION_MINOR 10
#define ENS_VERSION_PATCH 0
// If this is a release candidate, it will be reflected in the version name
// (i.e. the version name will be "RC1", "RC2", etc.). Otherwise the version
// name will typically be a seemingly arbitrary set of words that does not
// contain the capitalized string "RC".
#define ENS_VERSION_NAME "E-Bike Excitement"
#define ENS_VERSION_NAME "RC1"
// Incorporate the date the version was released.
#define ENS_VERSION_YEAR "2025"
#define ENS_VERSION_MONTH "04"
Expand Down
15 changes: 2 additions & 13 deletions tests/ada_belief_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,8 @@ using namespace ens;
using namespace ens::test;

TEMPLATE_TEST_CASE("AdaBelief_LogisticRegressionFunction", "[AdaBelief]",
ENS_ALL_TEST_TYPES)
ENS_ALL_CPU_TEST_TYPES)
{
AdaBelief adaBelief(0.032);
LogisticRegressionFunctionTest<TestType, arma::Row<size_t>>(adaBelief);
LogisticRegressionFunctionTest<TestType>(adaBelief);
}

#ifdef ENS_HAVE_COOT

TEMPLATE_TEST_CASE("AdaBelief_LogisticRegressionFunction", "[AdaBelief]",
coot::mat, coot::fmat)
{
AdaBelief adaBelief(0.032);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(adaBelief);
}

#endif
20 changes: 0 additions & 20 deletions tests/ada_bound_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,3 @@ TEMPLATE_TEST_CASE("AMSBound_SphereFunctionSpMatDenseGradient", "[AdaBound]",
REQUIRE(coordinates(0) == Approx(0.0).margin(0.1));
REQUIRE(coordinates(1) == Approx(0.0).margin(0.1));
}

#ifdef ENS_HAVE_COOT

TEMPLATE_TEST_CASE("AdaBound_SphereFunction", "[AdaBound]",
coot::mat, coot::fmat)
{
AdaBound optimizer(0.002, 2, 0.1, 1e-3, 0.9, 0.999, 1e-8, 500000,
1e-3, false);
FunctionTest<SphereFunction, TestType>(optimizer, 0.5, 0.1);
}

TEMPLATE_TEST_CASE("AMSBoundSphereFunctionTest", "[AdaBound]",
coot::mat, coot::fmat)
{
AMSBound optimizer(0.002, 2, 0.1, 1e-3, 0.9, 0.999, 1e-8, 500000,
1e-3, false);
FunctionTest<SphereFunction, TestType>(optimizer, 0.5, 0.1);
}

#endif
14 changes: 1 addition & 13 deletions tests/ada_delta_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,5 @@ TEMPLATE_TEST_CASE("AdaDelta_LogisticRegressionFunction", "[AdaDelta]",
// Use a large epsilon if we are using FP16, to avoid underflow in the first
// iterations.
AdaDelta adaDelta(32.0, 32, 0.95, sizeof(ElemType) == 2 ? 1e-4 : 1e-6);
LogisticRegressionFunctionTest<TestType, arma::Row<size_t>>(adaDelta);
LogisticRegressionFunctionTest<TestType>(adaDelta);
}

#ifdef ENS_HAVE_COOT

TEMPLATE_TEST_CASE("AdaDelta_LogisticRegressionFunction", "[AdaDelta]",
coot::mat, coot::fmat)
{
AdaDelta adaDelta(32.0);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(
adaDelta, 0.003, 0.006, 1);
}

#endif
13 changes: 1 addition & 12 deletions tests/ada_grad_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,5 @@ TEMPLATE_TEST_CASE("AdaGrad_LogisticRegressionFunction", "[AdaGrad]",
{
AdaGrad adagrad(31.5, 32, 10 * Tolerances<TestType>::Obj, 500000,
Tolerances<TestType>::Obj, true);
LogisticRegressionFunctionTest<TestType, arma::Row<size_t>>(adagrad);
LogisticRegressionFunctionTest<TestType>(adagrad);
}

#ifdef ENS_HAVE_COOT

TEMPLATE_TEST_CASE("AdaGrad_LogisticRegressionFunction", "[AdaGrad]",
coot::mat, coot::fmat)
{
AdaGrad adagrad(31.5, 32, 1e-8, 500000, 1e-9, true);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(adagrad);
}

#endif
14 changes: 1 addition & 13 deletions tests/ada_sqrt_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,9 @@ TEMPLATE_TEST_CASE("AdaSqrt_LogisticRegressionFunction", "[AdaSqrt]",
true);
// We allow a few trials for lower precision types because AdaSqrt can have
// trouble converging in that case.
LogisticRegressionFunctionTest<TestType, arma::Row<size_t>>(
LogisticRegressionFunctionTest<TestType>(
optimizer,
Tolerances<TestType>::LRTrainAcc,
Tolerances<TestType>::LRTestAcc,
sizeof(typename TestType::elem_type) < 4 ? 5 : 1);
}

#ifdef ENS_HAVE_COOT

TEMPLATE_TEST_CASE("AdaSqrt_LogisticRegressionFunction", "[AdaSqrt]",
coot::mat, coot::fmat)
{
AdaSqrt optimizer(8.0, 32, 1e-8, 150000, 1e-9, true);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(
optimizer);
}

#endif
93 changes: 0 additions & 93 deletions tests/adam_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,96 +215,3 @@ TEMPLATE_TEST_CASE("Adam_ThreeHumpCamelFunction", "[Adam]", ENS_ALL_TEST_TYPES)
Tolerances<TestType>::LargeObj,
Tolerances<TestType>::LargeCoord);
}

#ifdef ENS_HAVE_COOT

TEMPLATE_TEST_CASE("Adam_SphereFunction", "[Adam]", coot::mat, coot::fmat)
{
Adam optimizer(1.0, 2, 0.7, 0.999, 1e-8, 50000, 1e-3, false);
FunctionTest<SphereFunction, TestType>(optimizer, 0.5, 0.2);
}

TEMPLATE_TEST_CASE("Adam_StyblinskiTangFunction", "[Adam]", coot::mat)
{
Adam optimizer(1.0, 2, 0.7, 0.999, 1e-8, 50000, 1e-3, false);
FunctionTest<StyblinskiTangFunction, TestType>(optimizer, 0.5, 0.1);
}

TEMPLATE_TEST_CASE("Adam_McCormickFunction", "[Adam]", coot::mat)
{
Adam optimizer(0.5, 1, 0.7, 0.999, 1e-8, 50000, 1e-5, false);
FunctionTest<McCormickFunction, TestType>(optimizer, 0.5, 0.1);
}

TEMPLATE_TEST_CASE("Adam_MatyasFunction", "[Adam]", coot::mat)
{
Adam optimizer(0.5, 1, 0.7, 0.999, 1e-8, 50000, 1e-5, false);
FunctionTest<MatyasFunction, TestType>(optimizer, 0.1, 0.01);
}

TEMPLATE_TEST_CASE("Adam_EasomFunction", "[Adam]", coot::mat)
{
Adam optimizer(0.2, 1, 0.7, 0.999, 1e-8, 50000, 1e-5, false);
FunctionTest<EasomFunction, TestType>(optimizer, 1.5, 0.01);
}

TEMPLATE_TEST_CASE("Adam_BoothFunction", "[Adam]", coot::mat)
{
Adam optimizer(1e-1, 1, 0.7, 0.999, 1e-8, 50000, 1e-9, true);
FunctionTest<BoothFunction, TestType>(
optimizer,
50 * Tolerances<TestType>::Obj,
10 * Tolerances<TestType>::Coord);
}

TEMPLATE_TEST_CASE("Adam_LogisticRegressionFunction", "[Adam]", coot::mat)
{
Adam adam(0.032);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(adam);
}

TEMPLATE_TEST_CASE("AdaMax_LogisticRegressionFunction", "[Adam]", coot::mat)
{
AdaMax adamax(0.08, 8, 0.9, 0.999, 1e-8, 50000, 1e-9, true);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(adamax);
}

TEMPLATE_TEST_CASE("AMSGrad_LogisticRegressionFunction", "[Adam]", coot::mat)
{
AMSGrad amsgrad(0.08, 8, 0.9, 0.999, 1e-8, 50000, 1e-11, true);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(amsgrad);
}

TEMPLATE_TEST_CASE("Nadam_LogisticRegressionFunction", "[Adam]", coot::mat)
{
Nadam nadam(0.032);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(nadam);
}

TEMPLATE_TEST_CASE("NadaMax_LogisticRegressionFunction", "[Adam]", coot::mat)
{
NadaMax nadamax(0.08, 8, 0.9, 0.999, 1e-8, 50000, 1e-9, true);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(nadamax);
}

TEMPLATE_TEST_CASE("OptimisticAdam_LogisticRegressionFunction", "[Adam]",
coot::mat)
{
OptimisticAdam optimisticAdam(0.032);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(optimisticAdam);
}

TEMPLATE_TEST_CASE("Padam_LogisticRegressionFunction", "[Adam]", coot::mat)
{
Padam optimizer(0.032);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(optimizer);
}

TEMPLATE_TEST_CASE("QHAdam_LogisticRegressionFunction", "[Adam]",
coot::mat, coot::fmat)
{
QHAdam optimizer(0.032);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(optimizer);
}

#endif
29 changes: 1 addition & 28 deletions tests/aug_lagrangian_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using namespace ens::test;
* AugmentedLagrangianTestFunction class.
*/
TEMPLATE_TEST_CASE("AugLagrangian_AugLagrangianTestFunction", "[AugLagrangian]",
ENS_ALL_TEST_TYPES)
ENS_ALL_CPU_TEST_TYPES)
{
typedef typename TestType::elem_type ElemType;

Expand Down Expand Up @@ -92,30 +92,3 @@ TEMPLATE_TEST_CASE("AugLagrangian_GockenbachFunction", "[AugLagrangian]",
REQUIRE(coords(1) == Approx(-1.10778185).epsilon(coordTol));
REQUIRE(coords(2) == Approx(0.015099932).epsilon(coordTol));
}

#ifdef ENS_HAVE_COOT

TEMPLATE_TEST_CASE("AugLagrangian_GockenbachFunction", "[AugLagrangian]",
coot::mat, coot::fmat)
{
typedef typename ForwardType<TestType>::bvec BaseVecType;
typedef typename TestType::elem_type ElemType;

GockenbachFunction f;
AugLagrangianType<BaseVecType> aug;

TestType coords = f.template GetInitialPoint<TestType>();

if (!aug.Optimize(f, coords))
FAIL("Optimization reported failure.");

ElemType finalValue = f.Evaluate(coords);

// Higher tolerance for smaller values.
REQUIRE(finalValue == Approx(29.633926).epsilon(1e-3));
REQUIRE(coords(0) == Approx(0.12288178).epsilon(0.1));
REQUIRE(coords(1) == Approx(-1.10778185).epsilon(1e-3));
REQUIRE(coords(2) == Approx(0.015099932).epsilon(0.1));
}

#endif
22 changes: 2 additions & 20 deletions tests/bigbatch_sgd_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TEMPLATE_TEST_CASE("BBS_BB_LogisticRegressionFunction", "[BigBatchSGD]",
for (size_t batchSize = 350; batchSize < 360; batchSize += 5)
{
BBS_BB bbsgd(batchSize, 0.001, 0.1, 10000, 1e-8, true, true);
LogisticRegressionFunctionTest<TestType, arma::Row<size_t>>(bbsgd);
LogisticRegressionFunctionTest<TestType>(bbsgd);
}
}

Expand All @@ -38,24 +38,6 @@ TEMPLATE_TEST_CASE("BBS_Armijo_LogisticRegressionFunction", "[BigBatchSGD]",
for (size_t batchSize = 40; batchSize < 50; batchSize += 1)
{
BBS_Armijo bbsgd(batchSize, 0.005, 0.1, 10000, 1e-6, true, true);
LogisticRegressionFunctionTest<TestType, arma::Row<size_t>>(bbsgd);
LogisticRegressionFunctionTest<TestType>(bbsgd);
}
}

#ifdef ENS_HAVE_COOT

TEMPLATE_TEST_CASE("BBS_BB_LogisticRegressionFunction", "[BigBatchSGD]",
coot::mat, coot::fmat)
{
BBS_BB bbsgd(350, 0.001, 0.1, 10000, 1e-8, true, true);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(bbsgd);
}

TEMPLATE_TEST_CASE("BBS_Armijo_LogisticRegressionFunction", "[BigBatchSGD]",
coot::mat, coot::fmat)
{
BBS_Armijo bbsgd(40, 0.005, 0.1, 10000, 1e-6, true, true);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(bbsgd);
}

#endif
5 changes: 3 additions & 2 deletions tests/cd_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ using namespace ens::test;
* Test the correctness of the CD implementation by using a dataset with a
* precalculated minima.
*/
TEMPLATE_TEST_CASE("CD_LogisticRegressionFunction", "[CD]", ENS_ALL_TEST_TYPES)
TEMPLATE_TEST_CASE("CD_LogisticRegressionFunction", "[CD]",
ENS_ALL_CPU_TEST_TYPES)
{
typedef typename TestType::elem_type ElemType;

Expand All @@ -44,7 +45,7 @@ TEMPLATE_TEST_CASE("CD_LogisticRegressionFunction", "[CD]", ENS_ALL_TEST_TYPES)
* Test the correctness of the CD implemenation by using the sparse test
* function, with disjoint features which optimize to a precalculated minima.
*/
TEMPLATE_TEST_CASE("CD_SparseTestFunction", "[CD]", ENS_ALL_TEST_TYPES,
TEMPLATE_TEST_CASE("CD_SparseTestFunction", "[CD]", ENS_ALL_CPU_TEST_TYPES,
ENS_SPARSE_TEST_TYPES)
{
// The test function for parallel SGD should work with CD, as the gradients
Expand Down
25 changes: 1 addition & 24 deletions tests/cmaes_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace ens::test;
* make sure the results are acceptable.
*/
TEMPLATE_TEST_CASE("CMAES_LogisticRegressionFunction", "[CMAES]",
ENS_TEST_TYPES)
ENS_FULLPREC_TEST_TYPES)
{
BoundaryBoxConstraint<TestType> b(-10, 10);
CMAES<FullSelection, BoundaryBoxConstraint<TestType>> cmaes(
Expand Down Expand Up @@ -62,26 +62,3 @@ TEMPLATE_TEST_CASE("ApproxCMAES_EmptyTransformationLogisticRegressionFunction",
cmaes(0, EmptyTransformation<TestType>(), 16, 500, 1e-3);
LogisticRegressionFunctionTest<TestType>(cmaes, 0.01, 0.02, 5);
}

#ifdef ENS_HAVE_COOT

TEMPLATE_TEST_CASE("CMAES_LogisticRegressionFunction", "[CMAES]", coot::mat)
{
BoundaryBoxConstraint<TestType> b(-10, 10);
CMAES<FullSelection, BoundaryBoxConstraint<TestType>> cmaes(
0, b, 32, 500, 1e-3);
cmaes.StepSize() = 0.6;
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(
cmaes, 0.003, 0.006, 5);
}

TEMPLATE_TEST_CASE("CMAES_LogisticRegressionFunction", "[CMAES]", coot::fmat)
{
BoundaryBoxConstraint<TestType> b(-10, 10);
CMAES<FullSelection, BoundaryBoxConstraint<TestType>> cmaes(
120, b, 32, 500, 1e-3);
LogisticRegressionFunctionTest<TestType, coot::Row<size_t>>(
cmaes, 0.01, 0.02, 5);
}

#endif
Loading
Loading