Repository navigation
Fix VaEA worse elimination and align its selection with the reference - #42
Merged
Merged
Conversation
Worse elimination compared the solution just added by maximum-vector-angle-first with its nearest selected neighbour. That solution has the largest minimum angle by construction, so it almost never fell within pi/(2(N+1)) and the elimination never fired. In VaEA (and PlatEMO) it is the remaining solution with the smallest angle to the selected set that may replace its nearest selected neighbour. Also follow the reference in the rest of the selection: normalize over S_t = F_1 u ... u F_k rather than all 2N solutions, take the extreme solutions as those closest in angle to each axis, and select parents at random.
Zhenyu2Liang
approved these changes
Oct 26, 2026
Zhenyu2Liang
left a comment
Collaborator
There was a problem hiding this comment.
Thank you for fixing the bugs
Collaborator
|
I updated the axis-extreme selection to use unit = S_fit / (torch.norm(S_fit, dim=1, keepdim=True) + 1e-6)The worse-elimination regression test still passes on CPU and CUDA. Across seeds 0–2 with a population of 100 and 200 generations, ZDT1 results were unchanged and DTLZ2 results were nearly identical. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
VaEA's worse-elimination step almost never fires, which costs most of its convergence pressure. Over 200 generations withpop_size=100(3 seeds), ZDT1 ends at IGD 0.106 / 0.148 / 0.150, against about 0.005 for NSGA-II, NSGA-III and SPEA/R under the same budget.Worse elimination is applied to the wrong solution. In VaEA (Xiang et al., 2017, and PlatEMO's
VaEA/EnvironmentalSelection.m), each niching iteration does two things:ρwith the largest minimum angle to the selected set.π/(2(N+1))of its nearest selected solution and converges better (smaller sum of normalized objectives), it replaces that neighbour.The current loop runs step 2 on
ρitself. By construction,ρhas the largest minimum angle, so it is almost never within the threshold. The swap therefore essentially never happens: a better-converged solution right next to a selected one is never let in.The selection also differs from the reference in three smaller ways, which this PR aligns as well:
S_t = F_1 ∪ … ∪ F_k, not all2Nmerged solutions. Dominated solutions beyondF_kwere stretchingz_max.argminof each objective was used, which picks the solution at the opposite extreme.Effect (IGD after 200 generations,
pop_size=100, seeds 0–2, same script before and after):For reference, a version with only the elimination fix (keeping the tournament mating and the 2N normalization) gives 0.018 / 0.063 / 0.031 on ZDT1, so all four changes contribute.
Test.
test_vaea_worse_eliminationbuilds eight mutually non-dominated solutions. Two of them, P and Q, are about 2° apart, and P converges better. The test mocksevaluate, runs onestep(), and checks that P survives and Q does not.{(0,1), (1,0), (0.3,0.75), (0.51,0.5)}, i.e. Q is kept and P is dropped.unit_test/algorithms/test_moea_generated.pyalso passes.Checklist
ruff.