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

Enforce the constaint "x1*x2=32" #265

Closed
aleczhanshi opened this issue Mar 5, 2020 · 5 comments
Closed

Enforce the constaint "x1*x2=32" #265

aleczhanshi opened this issue Mar 5, 2020 · 5 comments
Assignees
Labels
wishlist Long-term wishlist feature requests

Comments

@aleczhanshi
Copy link

Hi there, following the last issue, is there a convenient way to have a constraint like "x1*x2=32" using the outcome variable or "metric"? In particular, I want to add this to https://github.com/pytorch/botorch/blob/master/tutorials/custom_botorch_model_in_ax.ipynb and need a strict equal instead of GEQ or LEQ. Thanks!

@Balandat
Copy link
Contributor

Balandat commented Mar 5, 2020

Can you just re-parameterize things on your end then?

Like get rid of x2 and only optimize over x1, then in your evaluation you just plug in x2 = 32 / x1? Or is your idea to model things across the whole domain (b/c you have data and want to use it) but put the constraint on only for the optimization?

@aleczhanshi
Copy link
Author

@Balandat Hmm, I kinda simplified it so this won't work in my problem. My problem is more like an optimization of f(x1, x2, x3, x4, x5, x6 ..., xn) where x1*x2*x3=32, x4*x5*x6=32, x1+x4<=8. Without specifying these constraints explicitly, the algorithm cannot even find a valid set of parameters. Is there any way that I can enforce this set of constraints?

@aleczhanshi
Copy link
Author

@Balandat Hi there, I'm following up to see if there's any update on this thread. Thanks!

@Balandat
Copy link
Contributor

Balandat commented Mar 6, 2020

Unfortunately, that setup isn't something we can easily support on the Ax frontend. In principle, you could specify these constraints for the optimization algorithm algorithm when generating new candidates, but that would have to happen on the lower level in botorch, essentially by passing the constraint according to scipy convention here: https://github.com/pytorch/botorch/blob/master/botorch/gen.py#L120-L128

This probably works ok if you have a decent model. My concern is that if you use this to generate candidates then your data will live on some lower-dimensional manifold defined by your constraints, and as a result my suspicion is that the model will have a very hard time getting reasonable fits.

I think doing this properly will require more sophisticated methods than we currently support.

@ldworkin ldworkin added the wishlist Long-term wishlist feature requests label Mar 9, 2020
@lena-kashtelyan
Copy link
Contributor

This issue is a duplicate of #153, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wishlist Long-term wishlist feature requests
Projects
None yet
Development

No branches or pull requests

4 participants