Skip to content

Add assume_pareto for hv calculation in _calculate_weights_below_for_multi_objective#6129

Merged
y0z merged 1 commit intooptuna:masterfrom
not522:assume_pareto
Jun 6, 2025
Merged

Add assume_pareto for hv calculation in _calculate_weights_below_for_multi_objective#6129
y0z merged 1 commit intooptuna:masterfrom
not522:assume_pareto

Conversation

@not522
Copy link
Copy Markdown
Member

@not522 not522 commented Jun 5, 2025

Motivation

The hypervolume calculation for the weights in TPESampler can be assume these points are on the Pareto front. This is because they have been processed to only include the Pareto front.

Description of the changes

  • Add assume_pareto for hv calculation in _calculate_weights_below_for_multi_objective

Benchmark

  • master: 26.196007 sec
  • PR: 22.274717 sec
import optuna


def objective(trial: optuna.Trial) -> tuple[float, float, float]:
    x = trial.suggest_float("x", -5, 5)
    y = trial.suggest_float("y", -5, 5)
    return x**2 + y**2, (x - 2)**2 + (y - 2)**2, (x + 2)**2 + (y + 2)**2


sampler = optuna.samplers.TPESampler(seed=42)
study = optuna.create_study(sampler=sampler, directions=["minimize"]*3)
study.optimize(objective, n_trials=1000)
trials = study.trials
print((trials[-1].datetime_complete - trials[0].datetime_start).total_seconds())

@not522 not522 added the enhancement Change that does not break compatibility and not affect public interfaces, but improves performance. label Jun 5, 2025
Copy link
Copy Markdown
Contributor

@nabenabe0928 nabenabe0928 left a comment

Choose a reason for hiding this comment

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

LGTM:)

@nabenabe0928
Copy link
Copy Markdown
Contributor

I confirmed the reproducibility as well:)

@nabenabe0928
Copy link
Copy Markdown
Contributor

@y0z Could you check this PR?

Copy link
Copy Markdown
Member

@y0z y0z left a comment

Choose a reason for hiding this comment

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

LGTM

@y0z y0z merged commit 1ab5c2e into optuna:master Jun 6, 2025
15 checks passed
@y0z y0z added this to the v4.4.0 milestone Jun 6, 2025
@not522 not522 deleted the assume_pareto branch June 6, 2025 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Change that does not break compatibility and not affect public interfaces, but improves performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants