-
Notifications
You must be signed in to change notification settings - Fork 303
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
Rounding issues when generating with constraints #733
Comments
Hi @yoavnavon, we'll look into this, but before we do, I have a quick question. What is the reason why you are manually generating and attaching trials instead of using I think using the canonical |
Hi @lena-kashtelyan, so I simplified the example the most I could, but basically I needed a lot of customization on the GP and acquisition function level that I could not do with the
I realize now that at the time I was using a somewhat old version of Ax (0.1.14), so maybe those problems were already addressed, but it would be helpful to know why it fails with my way. |
If you are not looking to use Ax storage (JSON or SQL), you can actually pass all those arguments through To achieve your code snippet above, you would do:
For more detail on generation strategy, we have this relatively new tutorial: https://ax.dev/tutorials/generation_strategy.html : ) Let me know if this doesn't work for you, we can then try to look into the rounding issue, but generally attaching trials that violate constraints is not supported through AxClient, so I'm not sure if we can easily fix that. It would be best to use the Service API canonically instead. P.S. The reason why this will prohibit use of Ax storage is that some of the arguments you are specifying via P.S.2 Also we have this new modular setup for making BoTorch models in Ax, see this tutorial: https://ax.dev/tutorials/modular_botax.html. This should allow you to achieve the same thing you are currently achieving with passing |
It looks like here the constraint not being satisfied is just an issue of numerical inaccuracy. I wonder if we should just change Ax/ax/core/parameter_constraint.py Line 78 in 4929a2e
weighted_sum <= self._bound + eps where ideally eps is dynamically looked up as the machine epsilon (e.g. via numpy). I can't really see much downsides to be just a little bit forgiving here
|
The reason #439 did not address this was b/c this was purely on the bounds on an individual parameter, here the issue is with the bound on a linear constraint. |
#734 should deal with this. |
Fix for this is now on master and will be part of the next stable release! |
Thanks for your help! |
The fix is now part of the latest stable version: 0.2.3. |
Problem
Hi, I've been trying to generate trials for an experiment with constraints, and I keep getting an error because the proposed trials don't satisfy the constraints by small differences, probably due to some rounding error somewhere. I did submit a similar issue once (#439) that seemed to be resolved, but may be related.
How To Replicate Error
Stack Trace
The text was updated successfully, but these errors were encountered: