I have just started using skopt so please feel free to redirect me to any basic tutorial that I might have missed. Anyway, here it goes:
I have an optimization problem where I calculate a 2-peaks spectrum via a complex physical model and then extract its Lorentzian profile (i.e. 6 parameters, 3 per peak). I then set up a cost function that calculates the squared difference between the calculated parameters and the experimental one, such that I get an f(x) that takes an array and returns a scalar (if I understood correctly that is what gp_minimize requires).
I set up the constraints of the problem using the following:
dim1=Real(name="A1", low=1, high=100) dim2=Real(name="A2", low=1, high=200)
dimensions = [dim1, dim2,...] but in my particular system A2 is bound by 2*A1. Is there a way to use this in constraints like shown above, to avoid searching a lot of "unphysical" parameter space? In my particular case evaluating the model is very time consuming so avoiding unnecessary calculations would be very helpful :)
Thanks in advance for your help!
Best, Chris
As of now, it does not seem possible to specify this type of dependence between dimensions of the search space. However, you could incorporate the constraint
a2 <= 2*a1
into the objective passed to the optimizer.In the example below, the "true" (and expensive) objective
f
is only evaluated if the constraint is met. Otherwise a high value is returned immediately.In the figure everything to the left of the dashed line violates
a2 <= 2*a1
. The red cross is the true minimum of the target f and the black dots are the objective evaluations. Due to the high objective values to the left of the line, the search focus is on the valid part of the search space. Of course there might also be evaluations in the invalid sub space (during initial random sampling or when "exploring" instead of "exploiting"), but those will not involve evaluation of the expensive targetf
.