Skip to content

isres: use the ranked survivors in the differential variation - #656

Open
inayatku wants to merge 1 commit into
stevengj:masterfrom
inayatku:isres-ranked-survivors
Open

inayatku wants to merge 1 commit into
stevengj:masterfrom
inayatku:isres-ranked-survivors

Conversation

@inayatku

Copy link
Copy Markdown
Contributor

Fixes #590.

The differential variation of Runarsson and Yao updates the k-th ranked survivor with gamma * (x_1 - x_{k+1}), where x_1 is the best survivor. The code had two indices in storage order instead of rank order:

  • memcpy(x0, xs, ...) copied storage slot 0, not the best survivor xs + irank[0]*n;
  • xs[(k+1)*n+j] is storage slot k+1, not the (k+1)-th ranked survivor xs[irank[k+1]*n+j].

This pull request changes both (variant RB in my comment on #590). The benchmark from that comment, 300 seeds per problem, successful runs and median evaluations:

problem master this PR
tutorial 291, 7481 291, 8380
g01 296, 148858 300, 152308
g04 300, 21156 300, 22608
g06 300, 29506 300, 20842
g07 24, 116010 274, 112489
g08 300, 5911 300, 6650
g09 298, 36896 300, 37304
g12 298, 7934 300, 7920
g24 300, 8599 300, 9523
Rosenbrock 300, 5714 300, 5115
Shekel 10 286, 12018 299, 13578

The change makes ISRES more reliable on the harder problems (g07, Shekel 10, g01) and faster on g06 and Rosenbrock. It needs 7% to 13% more evaluations on the tutorial problem, g04, g08 and g24. The benchmark program and the full output are on https://github.com/inayatku/nlopt/tree/isres-590-benchmark/test/isres_benchmark .

If you prefer the smaller change, I can reduce this to the x0 line only (variant B in the comment): it solves g07 in 128 of 300 runs and is at most 4.3% slower than master on these problems.

New test test/t_isres_ranking.cxx: ISRES on g06 with seeds 1 to 10. The runs must all reach f* + 0.1 and need fewer than 250000 evaluations in total. Master: 305863 (fails). This branch: 196685. In a resampling of the 300 benchmark runs, master passes this test with probability 0.005 and this branch fails it with probability 5e-5. The test takes about 1.5 s.

ctest: 89 of 89 pass (MSVC 2022).

The differential variation of Runarsson and Yao (2005) updates the k-th
ranked survivor with gamma * (x_1 - x_{k+1}), where x_1 is the best
survivor. The code used storage slot 0 for x_1 and storage slot k+1 for
x_{k+1}, which are not ranked. Copy the best-ranked survivor into x0
and use irank[k+1].

New test t_isres_ranking: ISRES on g06, seeds 1 to 10, total number of
evaluations to reach f* + 0.1 (305863 before, 196685 after).

Fixes stevengj#590.
@inayatku

Copy link
Copy Markdown
Contributor Author

@stevengj, this one is also ready for review. As in the description, I can reduce it to the x0 line only (variant B) if you prefer the smaller change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarification of potential bug in ISRES implementation

1 participant