bayesian-optimization / BayesianOptimization

A Python implementation of global optimization with gaussian processes.
https://bayesian-optimization.github.io/BayesianOptimization/index.html
MIT License
7.95k stars 1.55k forks source link

Optimize multiple functions #492

Closed laukejas closed 2 months ago

laukejas commented 4 months ago

Is your feature request related to a problem? Please describe. I am not entirely sure if this isn't already possible with the current implementation, but I looked through the docs and examples and couldn't find it. Please correct me if it's called something different and I missed it.

Basically, it seems that BayesianOptimization can only be instantiated with a single function:

optimizer = BayesianOptimization(
    f=black_box_function, ...

However, there may be multiple functions that need to be optimized (probably with certain weights). In current implementation, they can be merged into a single black box function by the user, but that hides the complexity of these functions from the optimizer and makes it difficult for it to reach convergence.

Describe the solution you'd like It would be great if it were possible to pass multiple functions to the BayesianOptimization constructor, similar to how bounds are defined. For example:

funcs= {'f1': black_box_function1, 'f2': black_box_function2, 'f3': black_box_function3}
optimizer = BayesianOptimization(
    f=funcs, ...

Not sure how difficult it would be to implement. Would appreciate a comment.

till-m commented 4 months ago

Hi @laukejas,

how would you like this to work in practice? You want a weighted sum of objectives, but model every target function with a seperate GP?

till-m commented 2 months ago

Closing due to inactivity