ppgaluzio / MOBOpt

Multi-objective Bayesian optimization
MIT License
81 stars 23 forks source link

opposite directions in objectives #5

Closed nikorose87 closed 4 years ago

nikorose87 commented 4 years ago

Hi again,

Sorry for writing so soon, I am setting a bi-optimal optimization problem, in which f1 needs to be minimized, while the f2 needs to be maximized. What I did was to change the sign in the maximized output. However, while the optimization was running, the f1 is being optimized but the f2 also did that.

Am I interpreting the settings in a proper manner? I do not why both were minimized.

Thanks

ppgaluzio commented 4 years ago

The algorithm was implemented as to maximize the objectives, so in this case, you need to change the signs when implementing your objective function:

def objective(x):
    ....
    return [-f1, f2]   # f1 is going to be minimized and f2 will be maximized
nikorose87 commented 4 years ago

It is running, however I had the feature mar_or_min='min'. That is why I inverted the max function.