From e131f63c4d970ba1d9f167f50896dc704a56e1e5 Mon Sep 17 00:00:00 2001 From: nabenabe0928 Date: Wed, 4 Dec 2024 13:57:58 +0100 Subject: [PATCH] Add the constraint split for no feasible observations --- package/samplers/ctpe/sampler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/samplers/ctpe/sampler.py b/package/samplers/ctpe/sampler.py index ca55c0e7..6725f2e8 100644 --- a/package/samplers/ctpe/sampler.py +++ b/package/samplers/ctpe/sampler.py @@ -110,7 +110,7 @@ def _build_parzen_estimators_for_constraints_and_get_quantiles( mpes_above: list[_ParzenEstimator] = [] quantiles: list[float] = [] for constraint_vals in constraints_vals.T: - is_satisfied = constraint_vals <= 0 + is_satisfied = (constraint_vals <= 0) | (constraint_vals == min(constraint_vals)) satisfied_trials = [t for t, include in zip(trials, is_satisfied) if include] unsatisfied_trials = [t for t, exclude in zip(trials, is_satisfied) if not exclude] mpes_below.append(