Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization of analytic functions #935

Closed
sgbaird opened this issue Apr 24, 2022 · 4 comments
Closed

Optimization of analytic functions #935

sgbaird opened this issue Apr 24, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request in progress question Further information is requested wishlist Long-term wishlist feature requests

Comments

@sgbaird
Copy link
Contributor

sgbaird commented Apr 24, 2022

In Section S.3.B of:

Hickman, R. J.; Aldeghi, M.; Häse, F.; Aspuru-Guzik, A. Bayesian Optimization with Known Experimental and Design Constraints for Chemistry Applications. arXiv:2203.17241 [cond-mat] 2022. https://dx.doi.org/10.48550/arXiv.2203.17241

they performed a multi-objective optimization with one objective as a black box and another objective (cost) that is analytically calculated, but that I think was also represented as a black box. A quick search led me to:

Olofsson, S.; Mehrian, M.; Calandra, R.; Geris, L.; Deisenroth, M. P.; Misener, R. Bayesian Multiobjective Optimisation With Mixed Analytical and Black-Box Functions: Application to Tissue Engineering. IEEE Trans. Biomed. Eng. 2019, 66 (3), 727–739. https://doi.org/10.1109/TBME.2018.2855404.

where they rederived a few multi-objective acquisition functions to consider one black box objective and one analytic objective.

This topic is related to #745, except that the analytic objective is actually an objective to be optimized rather than a non-linear constraint on the input parameters. This idea of mixed analytical and black box functions is pretty common in the physical sciences, where one seeks a tradeoff between increasing (often several) difficult-to-model performance metrics and lowering monetary cost. Monetary cost as part of a multi-objective optimization is something that's been on my mind, and now I am realizing some of the difficulties of efficiently implementing it.

I've considered a few things:

  • (Inefficiently) treat the analytic objective as a black-box model. Quoting @Balandat "why do we learn the constraint if we already know it in closed form?"
  • Use ModelListGP with "enough" noise-free training data to sufficiently learn the (often linear) analytic monetary cost function, which may actually be easy in some cases, but the comment directly above still applies here
  • Try to use/adapt the acquisition function from https://doi.org/10.1109/TBME.2018.2855404
  • EDIT: treat it as a constraint on the input parameters with an unrealistically high bound (I'm not sure if the soft constraint penalty gets larger as the constraint violation worsens, and I think it's possible this could completely throw off the candidate generation - not really sure)

Any thoughts/suggestions?

@Balandat
Copy link
Contributor

Yeah this is something that has come up in our own research also (cc @dme65, @qingfeng10).

On the BoTorch end, we have the DeterministicModel abstraction. You can e.g. use a GenericDeterministicModel that allows you to use a generic callable mapping inputs X out "DeterministicPosterior" objects (which are really just a lightweight container wrapping the function value so we can use existing machinery to combine them with other probabilistically modeled outcomes.

Unfortunately, we currently don't have a way to easily expose this on the top level Ax API. Ultimately, the correct solution is a refactor of our Modelbridge & Model APIs, and BoTorch interface that will make specifying such analytic functions (to be used both as objectives and as constraints) in Ax possible. But this is a rather comprehensive refactor that will take some thinking (and more coding).

There are probably some hacky ways to make things work in the meantime - maybe @dme65 has an example for this?

@lena-kashtelyan lena-kashtelyan added the question Further information is requested label Apr 25, 2022
@lena-kashtelyan
Copy link
Contributor

lena-kashtelyan commented Sep 13, 2022

We're working towards enabling this, so I'll label this as "in-progress". Also cc @dme65 for a potential hacky example @Balandat asked for above : )

@lena-kashtelyan lena-kashtelyan added enhancement New feature or request in progress labels Sep 13, 2022
@lena-kashtelyan lena-kashtelyan changed the title Suggestions for implementing multi-objective optimization of mixed analytic and black-box functions Optimization of analytic functions Sep 13, 2022
@sgbaird
Copy link
Contributor Author

sgbaird commented Oct 14, 2022

@dme65 any thoughts for a workaround?

@lena-kashtelyan
Copy link
Contributor

I think it will realistically be a bit before we can release a good DeterministicModel setup and relevant documentation, so I'm wishlisting this for now.

@lena-kashtelyan lena-kashtelyan added the wishlist Long-term wishlist feature requests label Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress question Further information is requested wishlist Long-term wishlist feature requests
Projects
None yet
Development

No branches or pull requests

4 participants