Skip to content

Commit 7c9e0ab

Browse files
committed
changed bound setting method to avoid nan and inf
1 parent f92fd3f commit 7c9e0ab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/optimagic/optimizers/nevergrad_optimizers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,11 @@ def _solve_internal_problem(
182182
" for more detailed installation instructions."
183183
)
184184

185-
instrum = ng.p.Instrumentation(
186-
ng.p.Array(init=x0, lower=problem.bounds.lower, upper=problem.bounds.upper)
185+
instrum = ng.p.Array(init=x0).set_bounds(
186+
lower=problem.bounds.lower, upper=problem.bounds.upper
187187
)
188+
instrum = ng.p.Instrumentation(instrum)
189+
188190
if self.seed is not None:
189191
instrum.random_state.seed(self.seed)
190192

0 commit comments

Comments
 (0)