You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2021/08/22 00:33:35 UTC

[commons-math] 11/13: Adapt input files for "SimplexOptimizerTest" (unit tests).

This is an automated email from the ASF dual-hosted git repository.

erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git

commit 1e7bce134ffb400040ac4fd61b2ebce50fea93a4
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Sun Aug 22 02:14:53 2021 +0200

    Adapt input files for "SimplexOptimizerTest" (unit tests).
    
    The current tests are "baseline" (2D) cases.
    Further work should check degradation with increased dimensionality.
---
 .../std_test_func.simplex.hedar_fukushima.csv      | 65 ++++++++++------------
 .../std_test_func.simplex.multidirectional.csv     | 64 ++++++++++-----------
 .../noderiv/std_test_func.simplex.nelder_mead.csv  | 64 ++++++++++-----------
 3 files changed, 87 insertions(+), 106 deletions(-)

diff --git a/commons-math-legacy/src/test/resources/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/std_test_func.simplex.hedar_fukushima.csv b/commons-math-legacy/src/test/resources/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/std_test_func.simplex.hedar_fukushima.csv
index fdd2fb4..3e6fa4c 100644
--- a/commons-math-legacy/src/test/resources/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/std_test_func.simplex.hedar_fukushima.csv
+++ b/commons-math-legacy/src/test/resources/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/std_test_func.simplex.hedar_fukushima.csv
@@ -17,42 +17,35 @@
 #
 # Format (CSV) defined in "SimplexOptimizerTest.Task" class.
 # Columns are:
-#  0: function name (value from "TestFunction" enum)
-#  1: space dimension (n)
-#  2: nominal start point ("n" space-separated values)
-#  3: optimum ("n" space-separated values)
-#  4: maximum expected distance from the result to the optimum
-#  5: expected number of function evaluations
-#  6: length of the sides of the initial simplex
-#  7: size of the random noise (to generate slightly different initial conditions)
-#  8: whether to perform simulated annealing
-#  9: [optional] File prefix for debugging (or empty slot for no debugging)
-# 10: [optional] Indices (space-separated) of simplex points to save (empty means "all points")
+#  0: Function name (value from "TestFunction" enum)
+#  1: Space dimension (n)
+#  2: Optimum ("n" space-separated values)
+#  3: Minimal radius of the spherical shell around the optimum (within which to randomly select a start point)
+#  4: Minimal radius of the spherical shell around the optimum (within which to randomly select a start point)
+#  5: Maximum expected distance from the result to the optimum
+#  6: Expected number of function evaluations
+#  7: Whether to perform simulated annealing
+#  8: [optional] File prefix for debugging (or empty slot for no debugging)
+#  9: [optional] Indices (space-separated) of simplex points to save (empty means "all points")
 #
 # Caveat: Some tests are commented out (cf. JIRA: MATH-1552).
 #
-PARABOLA, 2, 4.6 5.8, 0 0, 1e-4, 820, 1, 2e-1, true
-PARABOLA, 4, 2.5 3.1 4.6 5.8, 0 0 0 0, 1e-4, 820, 1, 2e-1, true
-ROSENBROCK, 2, -1.2 1, 1 1, 1e-4, 380, 1, 1e-1, true
-ROSENBROCK, 5, -4.4 -3.5 -2.6 -1.7 -0.8, 1 1 1 1 1, 1e-4, 3800, 5e-1, 1e-1, true
-ROSENBROCK, 10, -0.1 0.1 0.2 -0.1 -0.2 0.3 0.2 -0.1 0.2 -0.3, 1 1 1 1 1 1 1 1 1 1, 5e-5, 38000, 3, 5e-2, true
-POWELL, 4, 3 -1 -2 1, 0 0 0 0, 5e-3, 1100, 3, 1e-1, true
-CIGAR, 13, -1.2 2.3 -3.2 2.1 1.2 -2.3 3.2 -2.1 -1.2 2.3 -3.2 2.1 -1.2, 0 0 0 0 0 0 0 0 0 0 0 0 0, 5e-5, 75000, 3, 1e-1, true
-SPHERE, 13, -1.2 2.3 -3.2 2.1 1.2 -2.3 3.2 -2.1 -1.2 2.3 -3.2 2.1 -1.2, 0 0 0 0 0 0 0 0 0 0 0 0 0, 5e-4, 47000, 3, 1e-1, true
-ELLI, 10, 2 3 4 -3 -2 -1 2 3 4 3, 0 0 0 0 0 0 0 0 0 0, 1e-4, 25000, 3, 1e-1, true
-#TWO_AXES, 10, 2 3 4 -3 -2 -1 2 3 4 3, 0 0 0 0 0 0 0 0 0 0, 1e-4, 1000, 3, 1e-1, true
-#CIG_TAB, 10, 2 3 4 -3 -2 -1 2 3 4 3, 0 0 0 0 0 0 0 0 0 0, 1e-4, 1000, 3, 1e-1, true
-TABLET, 11, 2 3 4 -3 -2 -1 2 3 4 3 -1, 0 0 0 0 0 0 0 0 0 0 0, 2e-4, 41000, 3, 1e-1, true
-#DIFF_POW, 7, 1 -1 1 -1 1 -1 1, 0 0 0 0 0 0 0, 1e-2, 2500, 3, 1e-1, true
-SS_DIFF_POW, 6, -3.2 2.1 1.2 -2.3 3.2 -2.1, 0 0 0 0 0 0, 1e-3, 10500, 3, 1e-1, true
-#ACKLEY, 4, 3 4 -3 -2, 0 0 0 0, 1e-6, 1100, 3, 5e-1, true
-#RASTRIGIN, 4, 3 4 -3 -2, 0 0 0 0, 1e-6, 10000, 3, 5e-1, true
-#GRIEWANK, 3, -210 123 -456, 0 0 0, 1e-1, 1000, 50, 100, true
-#LEVY, 4, 4 -6 -2 8, 1 1 1 1, 1e-3, 3000, 1, 1, true
-#SCHWEFEL, 2, 100 -200, 420.9687 420.9687, 1, 300, 100, 100, true
-ZAKHAROV, 5, -4 -2 3 5 7, 0 0 0 0 0, 1e-4, 2200, 1.5, 1, true
-PERM, 2, -2 -1, 1 2, 2e-3, 210, 5e-1, 1e-1, true
-#PERM, 3, -2 -3 -1, 1 2 3, 5e-5, 200, 5e-1, 1e-1, true
-#PERM, 4, -2 -3 -4 -1, 1 2 3 4, 5e-4, 2200, 5e-1, 1e-1, true
-#PERM, 5, -2 -3 -4 -5 -1, 1 2 3 4 5, 5e-4, 200, 5e-1, 1e-1, true
-#STYBLINSKI_TANG, 4, 1 2 3 4, -2.903534 -2.903534 -2.903534 -2.903534, 1e-4, 500, 1, 5e-1, true
+PARABOLA, 8, 0 0 0 0 0 0 0 0, 20, 40, 1e-4, 7200, true
+ROSENBROCK, 2, 1 1, 0.9, 1.1, 1e-4, 420, true
+CIGAR, 2, 0 0, 2, 3, 5e-5, 240, true
+SPHERE, 2, 0 0, 2, 3, 5e-4, 200, true
+ELLI, 2, 0 0, 3, 4, 1e-4, 350, true
+TWO_AXES, 2, 0 0, 3, 4, 1e-4, 400, true
+CIG_TAB, 2, 0 0, 3, 4, 1e-3, 280, true
+TABLET, 2, 0 0, 3, 4, 2e-4, 340, true
+SUM_POW, 2, 0 0, 3, 4, 1e-2, 190,  true
+ACKLEY, 2, 0 0, 2, 4, 1e-6, 310, true
+#RASTRIGIN, 2, 0 0, 0.9, 1.1, 5e-5, 1000, true
+GRIEWANK, 2, 0 0, 2, 3, 1e-1, 500, true
+LEVY, 2, 1 1, 0.9, 1.1, 1e-3, 200, true
+SCHWEFEL, 2, 420.9687 420.9687, 9, 11, 1, 200, true
+ZAKHAROV, 2, 0 0, 3, 4, 1e-4, 1000, true
+PERM, 2, 1 2, 0.9, 1.1, 2e-3, 260, true
+STYBLINSKI_TANG, 2, -2.903534 -2.903534, 1, 2, 1e-4, 210, true
+#HAPPY_CAT, 2, -1 -1, 2, 3, 1e-4, 500, true
+#SALOMON, 2, 0 0, 2, 3, 1e-4, 500, true
diff --git a/commons-math-legacy/src/test/resources/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/std_test_func.simplex.multidirectional.csv b/commons-math-legacy/src/test/resources/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/std_test_func.simplex.multidirectional.csv
index 66824f0..f13c7eb 100644
--- a/commons-math-legacy/src/test/resources/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/std_test_func.simplex.multidirectional.csv
+++ b/commons-math-legacy/src/test/resources/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/std_test_func.simplex.multidirectional.csv
@@ -17,41 +17,35 @@
 #
 # Format (CSV) defined in "SimplexOptimizerTest.Task" class.
 # Columns are:
-#  0: function name (value from "TestFunction" enum)
-#  1: space dimension (n)
-#  2: nominal start point ("n" space-separated values)
-#  3: optimum ("n" space-separated values)
-#  4: maximum expected distance from the result to the optimum
-#  5: expected number of function evaluations
-#  6: length of the sides of the initial simplex
-#  7: size of the random noise (to generate slightly different initial conditions)
-#  8: whether to perform simulated annealing
-#  9: [optional] File prefix for debugging (or empty slot for no debugging)
-# 10: [optional] Indices (space-separated) of simplex points to save (empty means "all points")
+#  0: Function name (value from "TestFunction" enum)
+#  1: Space dimension (n)
+#  2: Optimum ("n" space-separated values)
+#  3: Minimal radius of the spherical shell around the optimum (within which to randomly select a start point)
+#  4: Minimal radius of the spherical shell around the optimum (within which to randomly select a start point)
+#  5: Maximum expected distance from the result to the optimum
+#  6: Expected number of function evaluations
+#  7: Whether to perform simulated annealing
+#  8: [optional] File prefix for debugging (or empty slot for no debugging)
+#  9: [optional] Indices (space-separated) of simplex points to save (empty means "all points")
 #
 # Caveat: Some tests are commented out (cf. JIRA: MATH-1552).
 #
-PARABOLA, 4, 2.5 3.1 4.6 5.8, 0 0 0 0, 1e-4, 380, 1, 2e-1, false
-ROSENBROCK, 2, -1.2 1, 1 1, 2e-3, 11100, 1, 1e-1, false
-#ROSENBROCK, 5, -4.4 -3.5 -2.6 -1.7 -0.8, 1 1 1 1 1, 1e-4, 180, 5e-1, 1e-1, false
-ROSENBROCK, 10, -0.1 0.1 0.2 -0.1 -0.2 0.3 0.2 -0.1 0.2 -0.3, 1 1 1 1 1 1 1 1 1 1, 3e-3, 100000, 1, 5e-2, false
-#POWELL, 4, 3 -1 -2 1, 0 0 0 0, 5e-3, 420, 1, 1e-1, false
-CIGAR, 13, -1.2 2.3 -3.2 2.1 1.2 -2.3 3.2 -2.1 -1.2 2.3 -3.2 2.1 -1.2, 0 0 0 0 0 0 0 0 0 0 0 0 0, 5e-6, 7000, 1, 1e-1, false
-SPHERE, 13, -1.2 2.3 -3.2 2.1 1.2 -2.3 3.2 -2.1 -1.2 2.3 -3.2 2.1 -1.2, 0 0 0 0 0 0 0 0 0 0 0 0 0, 5e-5, 3600, 1, 1e-1, false
-ELLI, 10, 2 3 4 -3 -2 -1 2 3 4 3, 0 0 0 0 0 0 0 0 0 0, 1e-4, 50000, 1, 1e-1, false
-TWO_AXES, 10, 2 3 4 -3 -2 -1 2 3 4 3, 0 0 0 0 0 0 0 0 0 0, 1e-6, 3200, 1, 1e-1, false
-CIG_TAB, 10, 2 3 4 -3 -2 -1 2 3 4 3, 0 0 0 0 0 0 0 0 0 0, 5e-6, 2900, 1, 1e-1, false
-TABLET, 11, 2 3 4 -3 -2 -1 2 3 4 3 -1, 0 0 0 0 0 0 0 0 0 0 0, 5e-6, 3200, 1, 1e-1, false
-DIFF_POW, 7, 1 -1 1 -1 1 -1 1, 0 0 0 0 0 0 0, 5e-4, 2500, 1, 1e-1, false
-SS_DIFF_POW, 6, -3.2 2.1 1.2 -2.3 3.2 -2.1, 0 0 0 0 0 0, 1e-3, 4000, 1, 1e-1, false
-ACKLEY, 4, 3 4 -3 -2, 0 0 0 0, 1e-6, 770, 1, 5e-1, false
-#RASTRIGIN, 4, 3 4 -3 -2, 0 0 0 0, 1e-6, 10000, 1, 5e-1, false
-#GRIEWANK, 3, -210 123 -456, 0 0 0, 1e-1, 1000, 50, 100, false
-#LEVY, 4, 4 -6 -2 8, 1 1 1 1, 1e-3, 3000, 1, 1, false
-#SCHWEFEL, 2, 100 -200, 420.9687 420.9687, 1, 300, 100, 100, false
-ZAKHAROV, 5, -4 -2 3 5 7, 0 0 0 0 0, 1e-4, 3100, 1.5, 1, false
-PERM, 2, -2 -1, 1 2, 3e-2, 25000, 5e-1, 1e-1, false
-#PERM, 3, -2 -3 -1, 1 2 3, 5e-5, 200, 5e-1, 1e-1, false
-#PERM, 4, -2 -3 -4 -1, 1 2 3 4, 5e-4, 2200, 5e-1, 1e-1, false
-#PERM, 5, -2 -3 -4 -5 -1, 1 2 3 4 5, 5e-4, 200, 5e-1, 1e-1, false
-#STYBLINSKI_TANG, 4, 1 2 3 4, -2.903534 -2.903534 -2.903534 -2.903534, 1e-4, 500, 1, 5e-1, false
+PARABOLA, 8, 0 0 0 0 0 0 0 0, 20, 40, 1e-4, 7200, false
+ROSENBROCK, 2, 1 1, 0.9, 1.1, 2e-3, 600, true
+CIGAR, 2, 0 0, 2, 3, 5e-5, 240, false
+SPHERE, 2, 0 0, 2, 3, 5e-4, 200, false
+ELLI, 2, 0 0, 3, 4, 1e-4, 350, false
+TWO_AXES, 2, 0 0, 3, 4, 1e-4, 400, false
+CIG_TAB, 2, 0 0, 3, 4, 1e-3, 280, false
+TABLET, 2, 0 0, 3, 4, 2e-4, 340, false
+SUM_POW, 2, 0 0, 3, 4, 1e-2, 190, false
+ACKLEY, 2, 0 0, 2, 4, 1e-6, 310, false
+#RASTRIGIN, 2, 0 0, 0.9, 1.1, 5e-5, 1000, false
+GRIEWANK, 2, 0 0, 2, 3, 1e-1, 500, false
+LEVY, 2, 1 1, 0.9, 1.1, 1e-3, 200, false
+SCHWEFEL, 2, 420.9687 420.9687, 9, 11, 1, 200, false
+ZAKHAROV, 2, 0 0, 3, 4, 1e-4, 1000, false
+PERM, 2, 1 2, 0.9, 1.1, 2e-3, 540, true
+STYBLINSKI_TANG, 2, -2.903534 -2.903534, 1, 2, 1e-4, 210, false
+#HAPPY_CAT, 2, -1 -1, 2, 3, 1e-4, 500, false
+#SALOMON, 2, 0 0, 2, 3, 1e-4, 500, false
diff --git a/commons-math-legacy/src/test/resources/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/std_test_func.simplex.nelder_mead.csv b/commons-math-legacy/src/test/resources/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/std_test_func.simplex.nelder_mead.csv
index 86dc3ab..457ae74 100644
--- a/commons-math-legacy/src/test/resources/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/std_test_func.simplex.nelder_mead.csv
+++ b/commons-math-legacy/src/test/resources/org/apache/commons/math4/legacy/optim/nonlinear/scalar/noderiv/std_test_func.simplex.nelder_mead.csv
@@ -17,41 +17,35 @@
 #
 # Format (CSV) defined in "SimplexOptimizerTest.Task" class.
 # Columns are:
-#  0: function name (value from "TestFunction" enum)
-#  1: space dimension (n)
-#  2: nominal start point ("n" space-separated values)
-#  3: optimum ("n" space-separated values)
-#  4: maximum expected distance from the result to the optimum
-#  5: expected number of function evaluations
-#  6: length of the sides of the initial simplex
-#  7: size of the random noise (to generate slightly different initial conditions)
-#  8: whether to perform simulated annealing
-#  9: [optional] File prefix for debugging (or empty slot for no debugging)
-# 10: [optional] Indices (space-separated) of simplex points to save (empty means "all points")
+#  0: Function name (value from "TestFunction" enum)
+#  1: Space dimension (n)
+#  2: Optimum ("n" space-separated values)
+#  3: Minimal radius of the spherical shell around the optimum (within which to randomly select a start point)
+#  4: Minimal radius of the spherical shell around the optimum (within which to randomly select a start point)
+#  5: Maximum expected distance from the result to the optimum
+#  6: Expected number of function evaluations
+#  7: Whether to perform simulated annealing
+#  8: [optional] File prefix for debugging (or empty slot for no debugging)
+#  9: [optional] Indices (space-separated) of simplex points to save (empty means "all points")
 #
 # Caveat: Some tests are commented out (cf. JIRA: MATH-1552).
 #
-PARABOLA, 4, 2.5 3.1 4.6 5.8, 0 0 0 0, 1e-4, 200, 1, 2e-1, false
-ROSENBROCK, 2, -1.2 1, 1 1, 1e-4, 180, 1, 1e-1, false
-ROSENBROCK, 5, -4.4 -3.5 -2.6 -1.7 -0.8, 1 1 1 1 1, 1e-4, 800, 5e-1, 1e-1, false
-ROSENBROCK, 10, -0.1 0.1 0.2 -0.1 -0.2 0.3 0.2 -0.1 0.2 -0.3, 1 1 1 1 1 1 1 1 1 1, 5e-5, 9000, 1, 5e-2, false
-POWELL, 4, 3 -1 -2 1, 0 0 0 0, 5e-3, 420, 1, 1e-1, false
-CIGAR, 13, -1.2 2.3 -3.2 2.1 1.2 -2.3 3.2 -2.1 -1.2 2.3 -3.2 2.1 -1.2, 0 0 0 0 0 0 0 0 0 0 0 0 0, 5e-5, 7000, 1, 1e-1, false
-SPHERE, 13, -1.2 2.3 -3.2 2.1 1.2 -2.3 3.2 -2.1 -1.2 2.3 -3.2 2.1 -1.2, 0 0 0 0 0 0 0 0 0 0 0 0 0, 5e-4, 3000, 1, 1e-1, false
-ELLI, 10, 2 3 4 -3 -2 -1 2 3 4 3, 0 0 0 0 0 0 0 0 0 0, 1e-4, 50000, 1, 1e-1, false
-#TWO_AXES, 10, 2 3 4 -3 -2 -1 2 3 4 3, 0 0 0 0 0 0 0 0 0 0, 1e-4, 5000, 1, 1e-1, false
-#CIG_TAB, 10, 2 3 4 -3 -2 -1 2 3 4 3, 0 0 0 0 0 0 0 0 0 0, 1e-4, 7000, 1, 1e-1, false
-TABLET, 11, 2 3 4 -3 -2 -1 2 3 4 3 -1, 0 0 0 0 0 0 0 0 0 0 0, 2e-4, 3600, 1, 1e-1, false
-#DIFF_POW, 7, 1 -1 1 -1 1 -1 1, 0 0 0 0 0 0 0, 5e-4, 2500, 1, 1e-1, false
-SS_DIFF_POW, 6, -3.2 2.1 1.2 -2.3 3.2 -2.1, 0 0 0 0 0 0, 1e-3, 4000, 1, 1e-1, false
-ACKLEY, 4, 3 4 -3 -2, 0 0 0 0, 1e-6, 430, 1, 5e-1, false
-#RASTRIGIN, 4, 3 4 -3 -2, 0 0 0 0, 1e-6, 10000, 1, 5e-1, false
-#GRIEWANK, 3, -210 123 -456, 0 0 0, 1e-1, 1000, 50, 100, false
-#LEVY, 4, 4 -6 -2 8, 1 1 1 1, 1e-3, 3000, 1, 1, false
-#SCHWEFEL, 2, 100 -200, 420.9687 420.9687, 1, 300, 100, 100, false
-ZAKHAROV, 5, -4 -2 3 5 7, 0 0 0 0 0, 5e-5, 500, 1.5, 1, false
-PERM, 2, -2 -1, 1 2, 5e-5, 200, 5e-1, 1e-1, false
-#PERM, 3, -2 -3 -1, 1 2 3, 5e-5, 200, 5e-1, 1e-1, false
-PERM, 4, -2 -3 -4 -1, 1 2 3 4, 5e-3, 2800, 5e-1, 1e-1, false
-#PERM, 5, -2 -3 -4 -5 -1, 1 2 3 4 5, 5e-4, 200, 5e-1, 1e-1, false
-#STYBLINSKI_TANG, 4, 1 2 3 4, -2.903534 -2.903534 -2.903534 -2.903534, 1e-4, 500, 1, 5e-1, false
+PARABOLA, 8, 0 0 0 0 0 0 0 0, 20, 40, 1e-4, 7200, false
+ROSENBROCK, 2, 1 1, 0.9, 1.1, 1e-4, 420, false
+CIGAR, 2, 0 0, 2, 3, 5e-5, 240, false
+SPHERE, 2, 0 0, 2, 3, 5e-4, 200, false
+ELLI, 2, 0 0, 3, 4, 1e-4, 350, false
+TWO_AXES, 2, 0 0, 3, 4, 1e-4, 400, false
+CIG_TAB, 2, 0 0, 3, 4, 1e-3, 280, false
+TABLET, 2, 0 0, 3, 4, 2e-4, 340, false
+SUM_POW, 2, 0 0, 3, 4, 1e-2, 190,  true
+ACKLEY, 2, 0 0, 2, 4, 1e-6, 310, false
+#RASTRIGIN, 2, 0 0, 0.9, 1.1, 5e-5, 1000, false
+GRIEWANK, 2, 0 0, 2, 3, 1e-1, 500, false
+LEVY, 2, 1 1, 0.9, 1.1, 1e-3, 200, false
+SCHWEFEL, 2, 420.9687 420.9687, 9, 11, 1, 200, false
+ZAKHAROV, 2, 0 0, 3, 4, 1e-4, 1000, false
+PERM, 2, 1 2, 0.9, 1.1, 2e-3, 260, false
+STYBLINSKI_TANG, 2, -2.903534 -2.903534, 1, 2, 1e-4, 210, false
+#HAPPY_CAT, 2, -1 -1, 2, 3, 1e-4, 500, false
+#SALOMON, 2, 0 0, 2, 3, 1e-4, 500, false