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

How to input complicated constraints in Bayesian Optimization that is not just lower and upper bound using Python? #189

Closed
RuoyunChen opened this issue Dec 4, 2019 · 4 comments

Comments

@RuoyunChen
Copy link

RuoyunChen commented Dec 4, 2019

Hi, I'm wondering is the package only capable of dealing with the simple lower and upper bound constraint? What if I have more complicated constraint (it is to do with calling another self-defined function), how do I input constraints like that?
Thanks!

@ben-arnao
Copy link
Contributor

ben-arnao commented Mar 8, 2020

Would anyone be interested if I tried to add additional sampling distributions other than a uniform? Or better yet maybe a way for user to define their own sampling function which for OP's case could work in defining custom constraints.

@julian-belina
Copy link

It would be really great if self defined functions could be applied as constraints. I have been doing some reserach on Bayesian optimization packages but non of the packages that are still maintained offers such functionality.
Only spearmint(https://github.com/HIPS/Spearmint) is able to do so but still utlizes python 2.7 and can only be called via command line input.
Gpoptflow(https://gpflowopt.readthedocs.io/en/latest/notebooks/constrained_bo.html) implemented equality constraints but no inequality constraints. Also it dosent seem that there is any current development on the repository either.

@sgbaird
Copy link

sgbaird commented Jan 30, 2022

@julian-belina Ax (unaffiliated) supports a variety of constraints out of the box. BoTorch (backbone of Ax, I'm also unaffiliated) supports equality, inequality, and nonlinear constraints (the last one has the caveat of requiring gradients, which can get tricky). Ax is on its way to getting the plumbing in order to support nonlinear constraints soon (again, you have to supply gradients).

@sgbaird
Copy link

sgbaird commented May 16, 2022

Differentiable, nonlinear inequality constraints are now supported in Ax, though it can take some care to get these implemented since it requires applying some BoTorch transforms manually. See facebook/Ax#769

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants