Skip to content

Commit

Permalink
Implement no optimization as a special NoOp optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
relf committed Jan 29, 2025
1 parent f2e2cf2 commit b1091b8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions smt/surrogate_models/krg_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,8 @@ def _initialize(self):
declare(
"hyper_opt",
"TNC",
values=("Cobyla", "TNC"),
values=("Cobyla", "TNC", "NoOp"),
desc="Optimiser for hyperparameters optimisation",
types=str,
)
declare(
"eval_noise",
Expand Down Expand Up @@ -2267,10 +2266,12 @@ def hessian_minus_reduced_likelihood_function(log10t):
)
if optimal_theta_res_loop["fun"] < optimal_theta_res["fun"]:
optimal_theta_res = optimal_theta_res_loop
elif self.options["hyper_opt"] == "NoOp":
optimal_theta_res["x"] = theta0

if "x" not in optimal_theta_res:
raise ValueError(
f"Optimizer encountered a problem: {optimal_theta_res_loop!s}"
f"Optimizer encountered a problem: {optimal_theta_res_loop}"
)
optimal_theta = optimal_theta_res["x"]

Expand Down

0 comments on commit b1091b8

Please sign in to comment.