Skip to content

Commit

Permalink
Fix to LHS ese comparison (#683)
Browse files Browse the repository at this point in the history
* Initial fix to comparison (Fixes #682 )

* Changed test cases reliant on lhs ese optimisation results

* Adding to contributors
  • Loading branch information
neal-ks authored Dec 2, 2024
1 parent 411fdd8 commit 2dad46e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ SMT has been developed thanks to contributions from:
* Maël Tremouille
* Mauricio Castano Aguirre
* Mostafa Meliani
* Neal Kesterton
* Nick Thompson
* Nicolas Gonel
* Nina Moëllo
Expand Down
6 changes: 3 additions & 3 deletions smt/applications/tests/test_ego.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ def f_obj(X):
LHS, design_space, criterion="ese", random_state=random_state
)
Xt = sampling(n_doe)
self.assertAlmostEqual(np.sum(Xt), 28.568852027679586, delta=1e-4)
self.assertAlmostEqual(np.sum(Xt), 33.56885202767958, delta=1e-4)
Xt = np.array(
[
[0.37454012, 1.0],
Expand Down Expand Up @@ -1151,8 +1151,8 @@ def f_obj(X):
n_start=25,
)
x_opt, y_opt, dnk, x_data, y_data = ego.optimize(fun=f_obj)
self.assertAlmostEqual(np.sum(y_data), 7.8471910288712, delta=1e-4)
self.assertAlmostEqual(np.sum(x_data), 34.81192549, delta=1e-4)
self.assertAlmostEqual(np.sum(y_data), 8.846225742003778, delta=1e-4)
self.assertAlmostEqual(np.sum(x_data), 41.81192549000013, delta=1e-4)

def test_ego_gek(self):
ego, fun = self.initialize_ego_gek()
Expand Down
2 changes: 1 addition & 1 deletion smt/sampling_methods/lhs.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def _maximinESE(
hist_T.extend(inner_loop * [T])
hist_proba.extend(inner_loop * [p_accpt])

if PhiP_best - PhiP_oldbest < tol:
if PhiP_oldbest - PhiP_best > tol:
# flag_imp = 1
if p_accpt >= 0.1 and p_imp < p_accpt:
T = 0.8 * T
Expand Down

0 comments on commit 2dad46e

Please sign in to comment.