Skip to content

Commit

Permalink
remove ucb log validator
Browse files Browse the repository at this point in the history
  • Loading branch information
roussel-ryan committed Jan 7, 2025
1 parent 4a3ed0f commit 49c25e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
13 changes: 3 additions & 10 deletions xopt/generators/bayesian/upper_confidence_bound.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,12 @@ class UpperConfidenceBoundGenerator(BayesianGenerator):
def validate_vocs_without_constraints(cls, v):
if v.constraints:
warnings.warn(
f"Using {cls.__name__} with constraints may lead to numerical issues if the base acquisition "
f"function has negative values."
f"Using {cls.__name__} with constraints will lead to invalid values "
f"if the base acquisition function has negative values. Use with "
f"caution."
)
return v

@field_validator("log_transform_acquisition_function")
def validate_log_transform_acquisition_function(cls, v):
if v:
raise ValueError(
"Log transform cannot be applied to potentially negative UCB "
"acquisition function."
)

def _get_acquisition(self, model):
objective = self._get_objective()
if self.n_candidates > 1 or isinstance(objective, CustomXoptObjective):
Expand Down
1 change: 0 additions & 1 deletion xopt/tests/generators/bayesian/test_mobo.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ def test_log_mobo(self):
gen = MOBOGenerator(
vocs=tnk_vocs,
reference_point=reference_point,
log_transform_acquisition_function=True,
)
gen = deepcopy(gen)
gen.n_monte_carlo_samples = 20
Expand Down

0 comments on commit 49c25e5

Please sign in to comment.