Repository navigation
feat(rvea): the authors' PlatEMO/jMetal reading of the survival as variant "platemo" (A10) - #367
Conversation
…, with two-layer lattices MOEA/D's weight_vectors, NSGA-III's reference_directions and RVEA's new reference_vectors (the last field, default None) take the same input, as jMetal and Evolver configure the three from the same weight files: a file with whitespace or commas, or a directory with jMetal's W<m>D_<n>.dat names (new for NSGA-III and RVEA); divisions, the complete Das-Dennis lattice (for RVEA the lattice of n_partitions); and, new, inner_divisions with divisions, Deb and Jain's two-layer lattice, the inside layer shrunk by half towards the centre as in pymoo and PlatEMO (156 vectors with eight objectives, 3 and 2 divisions). All go through load_or_generate_weight_vectors, and vector_source checks the options when a configuration is built. The vectors are the population: RVEA runs 100 individuals with three objectives from W3D_100.dat. A path that does not exist raises ConfigurationError for all three (MOEA/D created it as a directory); a directory without the file raises for NSGA-III and RVEA, while MOEA/D keeps saving the lattice in an existing directory. to_dict() leaves out reference_vectors while it is None and inner_divisions while unset, so configurations without them keep their 1.4.0 resolved specs and task ids. The resolved spec records MOEA/D's two-layer lattice and the file of NSGA-III and RVEA (lattices are already in their configuration). RVEA's command-line block takes reference_vectors; study planning rejects its path, as NSGA-III's, checks two-layer counts, and moves these checks to study/reference_planning.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… vectors vamos.algorithms.moead_populations(n_obj, *, max_pop_size=1000) returns the populations MOEA/D runs without weight options, as MOEADConfig.default and optimize build them: every size from 2 with one or two objectives, and with more the complete Das-Dennis lattices and the packaged jMetal files (100 with three or four objectives, 156 with eight). Other sizes need a file or a two-layer lattice, which the docstring and the MOEA/D reference explain. The tests run MOEA/D for 4 to 20 objectives with the populations it lists, and with a 10-objective two-layer lattice that no single lattice has. The public API snapshot is regenerated with tools/update_public_api_snapshot.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VAMOS documentation previewhttps://pr-367-vamos-docs-preview.vamos-optimization.workers.dev Built from |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f72e6a440
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…ions Settings such as two objectives with divisions=4 and inner_divisions=2 gave eight vectors but five directions: the three inside directions lie on the boundary lattice. RVEA accepted them as an eight-vector population, although a repeated niche never gets its own survivor and its zero angle to the nearest vector is clamped to 1e-64 in the penalty. two_layer_shared counts the shared directions exactly on the grid of both layers; two_layer_lattice raises ValueError, and MOEA/D, NSGA-III and RVEA raise ConfigurationError, for any overlap; study planning rejects it as INVALID_REFERENCE_DIRECTIONS. With inner_divisions < n_obj and divisions < 2 n_obj the layers never overlap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ther vectors A path in MOEA/D's weight_vectors, NSGA-III's reference_directions or RVEA's reference_vectors was replayed with whatever the file held when replay ran, while the resolved spec recorded only its name: a file replaced by other valid vectors of the same shape still verified as exact and reproduce() ran another experiment. MOEA/D's and NSGA-III's files had this gap on main too. The record of NSGA-III's and RVEA's files was also rebuilt with os.path.isfile, so a run whose file was moved, or verified on another machine, no longer matched it. When a run starts (optimize, the command-line builders, build_algorithm with a configuration, and study planning for MOEA/D), bind_config_vector_files resolves the path to the file the run reads (a directory becomes its W<m>D_<n>.dat) and records sha256, the digest of its vectors' shape and float64 values, in the resolved configuration. The run checks the digest before any evaluation, so replay refuses a changed file. The file records are rebuilt from the stored configuration alone; a MOEA/D record with sha256 is das_dennis when the digest is that of the lattice. A MOEA/D directory without the file, whose run generates the lattice, stays unbound, and runs stored without a digest keep their 1.4.0 description. The helpers move to components/vector_files.py, as weight_vectors.py reached its size budget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…platemo" VAMOS's RVEA follows pymoo: with two objectives the angle penalty uses M = 1, half of the published M (t/t_max)^alpha theta/gamma, the objectives are translated by the ideal point accumulated across generations, and the vectors adapt to the nadir point minus that ideal. RVEAConfig.variant (new last field and builder method) keeps this as "pymoo", the default, whose results are unchanged bitwise, and adds "platemo": the code of PlatEMO's RVEA/EnvironmentalSelection.m and ReferenceVectorAdaptation.m, which jMetal's RVEAEnvironmentalSelection follows, with M equal to the number of objectives, translation by the minimum of each generation's candidates and adaptation to the population's range. to_dict() leaves out the default. angle_penalized_distances factors out the penalty, which the tests check against 2 (t/t_max)^alpha theta/gamma with two objectives. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9f72e6a to
e4ca76d
Compare
NSGAIIIConfig.__post_init__ keeps both checks: the reference-direction source of this branch and the selection of #364. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Builds on #365 (
feat/reference-vector-files), which builds on #361: this branch starts from their commits, becauseRVEAConfig's new field must follow #365'sreference_vectors. Review the last commit.Problem
Item A10 of the VAMOS-Studio change requests (Part 2, information from a calibration study). VAMOS's RVEA follows pymoo's reading of the survival, not the authors' code in PlatEMO nor jMetal:
RVEA/EnvironmentalSelection.m,ReferenceVectorAdaptation.m) and jMetal (RVEAEnvironmentalSelection)M (t / t_max)^alpha theta / gammaPopObj - min(PopObj); jMetal'sRVEAGeometry.translate)V0 * (nadir - accumulated ideal)V0 * (max - min)of the population after selection (jMetal:ranges(translate(survivors)))With two objectives VAMOS's penalty is therefore half the published one.
Change
RVEAConfig.variant(new last field, and builder methodvariant(...)):"pymoo", the default, runs exactly what VAMOS ran (results checked bitwise against the parent branch on ZDT1, DTLZ2 and C1-DTLZ1), and"platemo"runs the authors' reading in the three rows above. Both keep VAMOS's progresst / t_maxin generations, its feasibility-first constrained survival and its parent selection, so"platemo"reproduces PlatEMO's selection on unconstrained problems; PlatEMO measures progress in evaluations and picks the least violated solution per vector under constraints, which this PR does not change.to_dict()leaves out the default, so existing configurations keep their resolved specs and task ids.survival.angle_penalized_distancesfactors out the penalty so that it can be tested.The name:
variant, asAGEMOEAConfig.variant("agemoea"/"agemoea_ii") names a reading of the same algorithm; the values name the code each reading follows. The default stays pymoo's, as asked: changing it would change every RVEA result.Docs, with Development after 1.4.0:: the
RVEAConfigdocstring and builder method, the RVEA tutorial, the RVEA configuration reference, and "Where the variants depart from their references" in the algorithms reference.Sources
PlatEMO/Algorithms/Multi-objective optimization/RVEA/:EnvironmentalSelection.m(PopObj - repmat(min(PopObj,[],1),N,1),APD = (1+M*theta*Angle/gamma).*norm),RVEA.m(theta = (FE/maxFE)^alpha, adaptation everyfr),ReferenceVectorAdaptation.m(V .* (max(PopObj) - min(PopObj))).C:/tmp/jmetal-pr, local/integration 9b6734c12):jmetal-component/.../replacement/impl/rvea/RVEAEnvironmentalSelection.java(numberOfObjectives * progress * angle / gamma,adaptReferenceVectorswithranges(translate(survivors))) andRVEAGeometry.java.Tests
tests/engine/test_rvea_variant.py(new):2 (t / t_max)^alpha theta / gammawith"platemo"and1 (t / t_max)^alpha theta / gammawith"pymoo"; with three objectives both use M = 3."platemo"translates by the candidates' minimum (its survivors are those of the smallest APD per niche from that origin),"pymoo"by the accumulated ideal, and both return the accumulated ideal."pymoo", leavesto_dict()unchanged, and gives the same results as an explicit"pymoo";"platemo"runs the exact budget and gives other results.ConfigurationError; the builder,to_dict/from_dictand exact replay (save_result,verify_run,reproduce) handle"platemo".test_constraint_handling_follows_the_fields_of_1_0listsvariantafterreference_vectors.Compatibility
Additive: the default is unchanged, bitwise, and so are the serialized configuration and resolved spec of every configuration that does not set
variant.Validation
All on Windows 11, Python 3.12, with
PYTHONPATHset to the worktree'ssrc(checked withvamos.__file__).pytest -q -n 4 tests/engine/test_rvea_variant.py tests/engine/test_agemoea_rvea_constraints.py tests/engine/test_agemoea_rvea_ask_tell.py tests/engine/test_rvea_partitions.py tests/engine/test_reference_vector_sources.py tests/engine/test_constraint_handling_algorithms.pyF, bitwiseruff checkandruff format --checkon the changed Pythonpython tools/typecheck.py --scope strict/--scope fullpython -m compileallon the changed Python;git diff --checkpython tools/check_agent_docs.pypytest -m "not slow" -n 4 -p no:cacheprovider -rfEtests/experiment/test_cli_ablation.py::test_cli_ablation_runs_and_writes_variants, which fails under xdist on Windows on untouchedmaintoo and passes alonepython tools/health.pymkdocs build --strictUpdate after review
This branch is rebased on #365 after its review fixes.
sha256of its vectors, and replay refuses a changed file before any evaluation. This covers MOEA/D's and NSGA-III's files too, which had the same gap onmain.Validation of the rebased branch:
pytest -m "not slow" -n 4: 10977 passed, 2 failed. One is the knowntest_cli_ablation_runs_and_writes_variants. The other istests/docs/test_site_polish.py::test_nested_404_keeps_theme_resources_on_the_preview_origin[/docs/1.0.1/], which hit aMemoryErrorwhile copying files; its file passes alone, 12 passed.tools/health.py: passed.mkdocs build --strict: no warnings.check_agent_docs: passed.Changelog entry
Added
variant:"platemo"runs the authors' reading of the survival, that of PlatEMO'sRVEA/EnvironmentalSelection.mand of jMetal (M equal to the number of objectives in the angle penalty also with two objectives, translation by each generation's minimum, vector adaptation to the population's range); the default"pymoo"keeps VAMOS's results.🤖 Generated with Claude Code