Skip to content

Commit

Permalink
fix get_default_partitioning_alpha for >7 objectives (#2646)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #2646

This ensures the approximation hyperparameter (alpha) for approximate box decompositions is less than 1.

Reviewed By: esantorella

Differential Revision: D66834901

fbshipit-source-id: d5eb8c9cbd8969fe27fb3a01e5dd192de9ab978a
  • Loading branch information
sdaulton authored and facebook-github-bot committed Dec 6, 2024
1 parent 5012fe8 commit 0d5e131
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion botorch/acquisition/multi_objective/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get_default_partitioning_alpha(num_objectives: int) -> float:
BotorchWarning,
stacklevel=3,
)
return 10 ** (-8 + num_objectives)
return 10 ** (-2 if num_objectives >= 6 else -3)


def prune_inferior_points_multi_objective(
Expand Down
6 changes: 3 additions & 3 deletions test/acquisition/multi_objective/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@

class TestUtils(BotorchTestCase):
def test_get_default_partitioning_alpha(self):
for m in range(2, 7):
expected_val = 0.0 if m < 5 else 10 ** (-8 + m)
for m in range(2, 9):
expected_val = 0.0 if m < 5 else 10 ** (-2 if m >= 6 else -3)
self.assertEqual(
expected_val, get_default_partitioning_alpha(num_objectives=m)
)
# In `BotorchTestCase.setUp` warnings are filtered, so here we
# remove the filter to ensure a warning is issued as expected.
warnings.resetwarnings()
with warnings.catch_warnings(record=True) as ws:
self.assertEqual(0.1, get_default_partitioning_alpha(num_objectives=7))
self.assertEqual(0.01, get_default_partitioning_alpha(num_objectives=7))
self.assertEqual(len(ws), 1)


Expand Down

0 comments on commit 0d5e131

Please sign in to comment.