Closed richinex closed 2 years ago
hi @richinex
For bounded minimization you'll want to use the bounds
argument rather than constr
:
res = minimize_constr(
lambda p0: obj_fun(p0, x, y, yerr), p,
bounds=dict(lb=lb, ub=ub)
)
Bounds are also equivalent to a linear constraint:
res = minimize_constr(
lambda p0: obj_fun(p0, x, y, yerr), p,
constr=dict(fun=lambda x: x, lb=lb, ub=ub)
)
I would like to ask if there is a way to implement bounds in the parameters when minimize_constr. I tried to follow the example as implemented in the adversarial example but I didnt quite understand. Here is my MWE. Thank you