Skip to content

Ignore points that do not dominate the reference point in hv - #254

Merged
BillHuang2001 merged 1 commit into
EMI-Group:mainfrom
raashish1601:fix/hv-non-dominating-points
Oct 9, 2026
Merged

BillHuang2001 merged 1 commit into
EMI-Group:mainfrom
raashish1601:fix/hv-non-dominating-points

Conversation

@raashish1601

Copy link
Copy Markdown
Contributor

Description

evox.metrics.hv measures each point from the reference point with torch.abs(objs - ref). For a point that is worse than the reference point on some objective, the abs turns that negative distance into a positive one, so the point still adds a box to the hypervolume. Such points should add nothing (they do not dominate the reference point), which is common in early generations:

ref = torch.tensor([1.0, 1.0])
hv(torch.tensor([[1.5, 0.5]]), ref)               # 0.25, expected 0
hv(torch.tensor([[0.2, 0.6], [1.5, 0.5]]), ref)   # ~0.37, expected 0.32

(pymoo's HV(ref_point=ref) gives 0 and 0.32 for these.)

The distances are now torch.clamp(ref - objs, min=0), so a point that is not better than the reference point on an objective has a zero-width box and is never counted. Shapes stay the same, so this still works with compile and vmap. I also noted in the docstring that the objectives are minimized.

Added unit_test/metrics/test_hv.py with a case of two dominating points (0.47) and the two cases above. The second test fails before the change.

Checklist

  • I have formatted my Python code with ruff.
  • I have good commit messages.
  • If adding new algorithms, problems, operators:
    • Added related test cases.
    • Added docstring to explain important parameters.
    • Added entries in the docs.

@BillHuang2001
BillHuang2001 merged commit e252b71 into EMI-Group:main Oct 9, 2026
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.

2 participants