Skip to content

Commit 68cb881

Browse files
committed
Increase burn in when creating initial values with equality constraints
1 parent baaf917 commit 68cb881

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CADETProcess/optimization/optimizationProblem.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2650,6 +2650,8 @@ def create_initial_values(
26502650
Initial values for starting the optimization.
26512651
26522652
"""
2653+
burn_in = int(burn_in)
2654+
26532655
class CustomModel():
26542656
def __init__(self, log_space_indices: list):
26552657
self.log_space_indices = log_space_indices

CADETProcess/optimization/pymooAdapter.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,26 @@ def run(self, optimization_problem: OptimizationProblem, x0=None):
7272
"""
7373
pop_size = self.get_population_size(optimization_problem)
7474

75+
# equality constraints make it more difficult to find feasible samples
76+
# in the parameter space. Therefore increase burnin
77+
# this gets very expensive with lots of constraints
78+
burn_in = 1e5 * 10 ** optimization_problem.n_linear_equality_constraints
79+
7580
if x0 is not None:
7681
pop = x0
7782
else:
7883
pop = optimization_problem.create_initial_values(
79-
pop_size, method='chebyshev', seed=self.seed
84+
pop_size, method='chebyshev', seed=self.seed,
85+
burn_in=burn_in
8086
)
8187

8288
pop = np.array(pop, ndmin=2)
8389

8490
if len(pop) < pop_size:
8591
n_remaining = pop_size - len(pop)
8692
remaining = optimization_problem.create_initial_values(
87-
n_remaining, method='chebyshev', seed=self.seed
93+
n_remaining, method='chebyshev', seed=self.seed,
94+
burn_in=burn_in
8895
)
8996
pop = np.vstack((pop, remaining))
9097
elif len(pop) > pop_size:

0 commit comments

Comments
 (0)