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

Smart rounding #146

Open
jduerholt opened this issue Mar 21, 2023 · 6 comments
Open

Smart rounding #146

jduerholt opened this issue Mar 21, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request hackathon

Comments

@jduerholt
Copy link
Contributor

@DavidWalz cc @jkleinekorte and @bertiqwerty

I thought about rounding functionalities in bofire for example in the context of using continuous relaxations for NChooseK as described in #145 which could lead to subtle numeric violations of the original constraint. Ideally we would have a rounding function which takes as input the domain with all features and constraints in addition to the generated candidate and then rounds it to the closest feasible solution.

Another relevant example would be if would introduce something like precision or step size for the ContinuousInput, especially if it used in combination with some kind of linear constraint and a direct rounding to the next allowed level would lead to constraint violations.

Could one not describe this rounding problem as a mixed integer optimization problem where we want to minimize the (squared) distance between a rounded feasible solution and the actual proposed candidate under the provided constraints and discretization levels?

What do you think?

@DavidWalz
Copy link
Contributor

Yes, restoring feasibility for {NChooseK + linear constraints} with L2 distance to the orginal point as objective is an MIQP.
We can pull in an additional dependecy to do this. python-mip and cvxpy (with CBC as solver) are lightweight, but only support LPs, so the L2^2 function would need to be linearized. pyomo also allows for formulating QPs and apparently CBC can solve them, but pyomo might be a bit heavy. Alternatively an L1 distance could be used which only involves max.
Restoring feasibility for nonlinear constraints wouldn't work.
Is that what you have in mind?

There are some space filling designs that can be formulated as MIPs and certain surrogates could be optimized globally (like is done in ENTMOOT), so in general I like the idea of extending bofire in that direction.

@DavidWalz
Copy link
Contributor

ping @R-M-Lee

@jduerholt
Copy link
Contributor Author

Yes, I have a MIQP in mind and more specifically a function which gets as input a domain, and a candidate and returns the rounded solution ;) I am not an expert in this kind of optimization, but could we not use cvxpy in combination with pyscipopt, as described here?

We should then also add a preciscion attribute to the ContinuousInputFeauture.

@DavidWalz
Copy link
Contributor

Nice. A drawback is that pyscipopt does not provide wheels so it's again conda (at least for windows) or getting scip compiled in our containerized backends. Given that it's the same for ipopt that's ok. It just means that the smart rounding would be optional and can't be relied on to be present.

@jduerholt
Copy link
Contributor Author

This would be fine for me ...

@rosonaeldred
Copy link

#166

@rosonaeldred rosonaeldred added enhancement New feature or request hackathon labels Apr 24, 2023
@dlinzner-bcs dlinzner-bcs linked a pull request Apr 24, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hackathon
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants