Skip to content

add multi objective BOHB optimizer - #141

Open
14e6 wants to merge 5 commits into
mainfrom
feature/mo-bohb
Open

add multi objective BOHB optimizer#141
14e6 wants to merge 5 commits into
mainfrom
feature/mo-bohb

Conversation

@14e6

@14e6 14e6 commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Reuses most of single objective BOHB, but replaces the single-objective based decisions with ranking configurations by nondominated (Pareto) front and breaks ties within the boundary front by crowding distance (NSGA-II style).
I moved a couple of tests around and the shared KDE sampler bit around to get a clean base for the single and multi objective variants, apologies for that - hope it doesn't make this PR that unnecessarily complex to read.
Also, I broke some of the public import paths, thus the bump of the major version.

Signed-off-by: Grossberger Lukas (CR/AIR3) <Lukas.Grossberger@de.bosch.com>
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  blackboxopt
  __init__.py
  blackboxopt/optimizers
  bohb.py 28-29
  hyperband.py 29-30
  mobohb.py 21-22
  blackboxopt/optimizers/staged
  bohb.py
  hyperband.py
  iteration.py
  kde_sampler.py 71-72, 76-82, 273, 321, 375-380, 392-396, 475
  mobohb.py 34
  optimizer.py
  utils.py
Project Total  

This report was generated by python-coverage-comment-action

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of this just moved to kde_sampler.py, I like a side by side diff to make this easier to read.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These also just moved from the staged/bohb_test.py

assert max_fidelity_best == mid_fidelity_best


def test_sample_configurations():

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also just moved from staged/bohb_test.py

Signed-off-by: Grossberger Lukas (CR/AIR3) <Lukas.Grossberger@de.bosch.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Supported dependency versions, invalid-loss ranking, and KDE fallback handling can currently produce import or optimization failures.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds MO-BOHB with Pareto-front ranking and NSGA-II crowding distance, while extracting BOHB’s shared KDE and staged scheduling infrastructure.

Changes:

  • Adds the MO-BOHB optimizer, dependency extra, documentation, and tests.
  • Generalizes staged optimization for single and multiple objectives.
  • Moves shared KDE sampling code and bumps the package to 6.0.0.
File summaries
File Description
blackboxopt/__init__.py Bumps version to 6.0.0.
blackboxopt/optimizers/bohb.py Adopts generalized staged scheduling.
blackboxopt/optimizers/hyperband.py Adopts generalized staged scheduling.
blackboxopt/optimizers/mobohb.py Adds the public MO-BOHB optimizer.
blackboxopt/optimizers/staged/bohb.py Retains single-objective KDE specialization.
blackboxopt/optimizers/staged/hyperband.py Generalizes iteration construction and promotion.
blackboxopt/optimizers/staged/iteration.py Stores and processes objective vectors.
blackboxopt/optimizers/staged/kde_sampler.py Extracts shared KDE sampling machinery.
blackboxopt/optimizers/staged/mobohb.py Adds Pareto ranking and MO-KDE splitting.
blackboxopt/optimizers/staged/optimizer.py Splits staged schedulers by objective type.
blackboxopt/optimizers/staged/utils.py Updates scalar promotion for loss vectors.
docs/optimizers/mobohb.md Documents MO-BOHB behavior.
mkdocs.yml Adds MO-BOHB documentation navigation.
pyproject.toml Adds the MO-BOHB extra and version bump.
tests/optimizers/bohb_test.py Relocates BOHB sampling coverage.
tests/optimizers/mobohb_test.py Tests public MO-BOHB behavior.
tests/optimizers/staged/bohb_test.py Retains BOHB sampler-specific tests.
tests/optimizers/staged/iteration_test.py Updates tests for vector losses.
tests/optimizers/staged/kde_sampler_test.py Tests shared KDE utilities.
tests/optimizers/staged/mobohb_test.py Tests Pareto ranking and MO sampling.
uv.lock Locks version and MO-BOHB dependencies.
Review details
  • Files reviewed: 20/21 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pyproject.toml Outdated
Comment thread blackboxopt/optimizers/staged/kde_sampler.py Outdated
Comment thread blackboxopt/optimizers/staged/mobohb.py Outdated
14e6 added 3 commits September 3, 2026 09:09
Signed-off-by: Grossberger Lukas (CR/AIR3) <Lukas.Grossberger@de.bosch.com>
… fallback

Signed-off-by: Grossberger Lukas (CR/AIR3) <Lukas.Grossberger@de.bosch.com>
Signed-off-by: Grossberger Lukas (CR/AIR3) <Lukas.Grossberger@de.bosch.com>
best_vector = convert_from_statsmodels_kde_representation(
vector, self.vartypes
)
continue

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That fallback was missing the convert_from_statsmodels_kde_representation which I added.

)
from pymoo.util.nds.efficient_non_dominated_sort import (
efficient_non_dominated_sort,
)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to have moved to:

from pymoo.functions.standard.non_dominated_sorting import (
    efficient_non_dominated_sort,
)

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.

3 participants