-
Notifications
You must be signed in to change notification settings - Fork 295
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
Constraints on FixedParameters are not allowed #2455
Comments
Hi @Fa20,
Ax only supports linear constraints, since those are easily passed down to the modeling layer and incorporated into the optimization. One imperfect-but-potentially-useful way to incorporate these constraints is as OutcomeConstraints, i.e., supply the scalar you'd like to constrain as an outcome of your experiment, and then set constraints on that scalar's value via outcome constraints (pointer). Hope that helps! |
@bernardbeckerman thanks for your answer . how can I convert the constarined to scaler and it is depend on the value of x1,x2 etc. which has range between two values? as wellas I have 3 constatins not just the above one? |
Following the example in this tutorial, you can do this by adding an outcome_constraint to the
and then adding the calculation of the desired quantity to the
Hope that helps! |
Does this the same like if we set the constrained on parameters?does this mean that the suggested values of parameters will satisfy this condition. Because I need the values of the parameters to simulate the objective functions after each trial in order to get the value of the objective functions |
and I have MOO problem |
If you follow my recommendation here (link) to avoid computation of the objective(s) if the (nonlinear) constraint is violated, then any trial with status COMPLETED should satisfy the constraint. This should work with constrained or non-constrained optimization. Does that make sense? |
@Fa20 have you had luck with the above suggestion? Closing this out for now but please feel free to comment/reopen with any further questions. |
ok thank you very much |
ax_client.create_experiment(
name="multi_objective_optimization",
parameters=[{"name": "x11", "type": "fixed", "value": 500, "value_type": "int"},
{"name": "x1", "type": "range", "bounds": [-1, 3], "value_type": "int"},
{"name": "x2", "type": "range", "bounds": [-2, 2], "value_type": "int"},
{"name": "x3", "type": "range", "bounds": [-2.0, 2.0], "value_type": "float"},
{"name": "x4", "type": "range", "bounds": [-20, 20], "value_type": "int"}
],
objectives={
"objective_1": ObjectiveProperties(minimize=True),
"objective_2": ObjectiveProperties(minimize=False),
},
parameter_constraints=[
"x4 - 1.5x3 >= 0", # Constraint involving x4 and x3
"x2 - 5x1 <= 0", # Constraint involving x2 and x1
"x11 - x3 >= 0",
]. How can I fix this problem in case that I want to keep this constarined "x11 - x3 >= 0" and x11 has a fixed value
another question: does AX support complex constarined like :
dist = 100 / x4
length = ((x2 / np.tan(np.radians(x3))) / (x11 * math.pi) * 100)
constarined= (length / dist) >= 3
The text was updated successfully, but these errors were encountered: