You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Re-index TorchOptConfig.objective_thresholds from (n_outcomes,) to (n_objectives,) (#5018)
Summary:
Re-index `objective_thresholds` in `TorchOptConfig` from `(n_outcomes,)` with NaN
for non-objective outcomes to `(n_objectives,)` or `None`. This is a prerequisite
for supporting `ScalarizedObjective` as a sub-objective of `MultiObjective`.
Key changes:
- `extract_objective_thresholds` returns `(n_objectives,)` maximization-aligned
array (sign-flipped for minimize objectives), or `None` for single-objective.
Rewritten to use expression-based API (`parse_objective_expression` /
`extract_metric_weights_from_objective_expr`) instead of deprecated
`MultiObjective.objectives` / `ScalarizedObjective` class checks.
- `_untransform_objective_thresholds` indexes by objective index and un-flips
the sign when converting back to raw `ObjectiveThreshold.bound`.
- Replaced `get_weighted_mc_objective_and_objective_thresholds` with
`get_weighted_mc_objective`, which only returns the objective (thresholds
no longer need transformation so callers use them directly).
- `infer_objective_thresholds` returns `(n_objectives,)` maximization-aligned.
- Removed `objective_thresholds` from `SubsetModelData` and `subset_model`
(thresholds are per-objective, not per-outcome, so subsetting doesn't apply).
- Simplified `_objective_threshold_to_outcome_constraints` and pruning logic.
- Merged `_full_objective_thresholds` and `_objective_thresholds` into single
`_objective_thresholds` in the `Acquisition` class.
- Pass thresholds directly as `ref_point` to BoTorch input constructors (using
the new `ref_point` parameter from D96473523), avoiding the need to convert
back to outcome space.
- Fixed Pyre type errors in `test_acquisition.py` for `Optional[Tensor]`
return from `Acquisition.objective_thresholds`.
TRBO isolation (axoptics):
- TRBO uses its own `objective_weights` and `max_reference_point` from
constructor kwargs -- it does NOT use `TorchOptConfig` from `gen()`.
Its `__init__` expects legacy format: `(n_outcomes,)` with raw bounds and
NaN for non-objectives, then handles maximization alignment internally.
- Replaced the `extract_objective_thresholds` call in axoptics
`_mk_TRBO_generation_strategy` with inline legacy logic that produces the
`(n_outcomes,)` raw-bounds format TRBO expects, keeping TRBO isolated from
the new `(n_objectives,)` format.
- Added comments to `trbo.py` documenting the legacy input contract and
future refactoring TODO.
Differential Revision: D96391935
0 commit comments