You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to solve a multi-objective optimization problem that has a relatively complex parameter constraint involving squares and square roots. So far I have failed to do this as the API does not seem to accept np.square for example.
Here is the code I'm using:
ax_client.create_experiment(
name="moo_experiment",
parameters=[
{
"name": f"x{i+1}",
"type": "range",
"bounds": [400, 500],
}
for i in range(2)
],
objectives={
# `threshold` arguments are optional
"a": ObjectiveProperties(minimize=False),
"b": ObjectiveProperties(minimize=False)
},
overwrite_existing_experiment=True,
is_test=True,
parameter_constraints=["-np.sqrt(2*np.square( 0.5*x1 )) + x1 <= -100"],
)
Which produces the following error:
AssertionError: Parameter not in dict_keys(['x1', 'x2'])
Is there any way in which I can implement this constraint? I've also tried reformulating the constraint to get rid of the square root which (I think) yields 0.5x12 - x22 - 200x2 >= 10000, but this gives the same error (perhaps because of the squared terms?).
Is there any solution for this?
The text was updated successfully, but these errors were encountered:
Hi, unfortunately we currently do not support non-linear parameter constraints. #769 has a pretty lengthy discussion of this, incl. pointers to other issues as well a draft PR (#794) that can allow this - but this is very much preliminary work and can potentially cause unwanted behavior when interacting with the transforms we do of the parameters - if you want to try this out USE AT YOUR OWN RISK.
Closing as duplicate of #153 that is already on our wishlist. As @Balandat states, full support for this is not likely in the short-term, and #769 discusses some very experimental workarounds.
Hi all,
I'm trying to solve a multi-objective optimization problem that has a relatively complex parameter constraint involving squares and square roots. So far I have failed to do this as the API does not seem to accept np.square for example.
Here is the code I'm using:
Which produces the following error:
AssertionError: Parameter not in dict_keys(['x1', 'x2'])
Is there any way in which I can implement this constraint? I've also tried reformulating the constraint to get rid of the square root which (I think) yields 0.5x12 - x22 - 200x2 >= 10000, but this gives the same error (perhaps because of the squared terms?).
Is there any solution for this?
The text was updated successfully, but these errors were encountered: