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

Add support for constraints in Ax generators using the Service API #170

Merged
merged 11 commits into from
Feb 5, 2024

Conversation

AngelFP
Copy link
Member

@AngelFP AngelFP commented Jan 27, 2024

Adds the possibility of providing parameter_constraints and outcome_constraints in the generators that use the Ax Service API.

Example:

var1 = VaryingParameter("x0", -50.0, 5.0)
var2 = VaryingParameter("x1", -5.0, 15.0)
obj = Objective("f", minimize=False)
p1 = Parameter("p1")

gen = AxSingleFidelityGenerator(
    varying_parameters=[var1, var2],
    objectives=[obj],
    analyzed_parameters=[p1],
    parameter_constraints=["x0 + x1 <= 10"],
    outcome_constraints=["p1 <= 30"]
)

@AngelFP AngelFP added the enhancement New feature or request label Jan 27, 2024
@AngelFP AngelFP requested a review from delaossa January 29, 2024 15:35
Copy link
Collaborator

@delaossa delaossa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Angel. It looks good!

@@ -74,9 +76,14 @@ def test_ax_single_fidelity():
var1 = VaryingParameter("x0", -50.0, 5.0)
var2 = VaryingParameter("x1", -5.0, 15.0)
obj = Objective("f", minimize=False)
p1 = Parameter("p1")

gen = AxSingleFidelityGenerator(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constraint parameter capabilities were also added to AxMultiFidelityGenerator.
Don't you want to add a test for this too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. Apparently the multi-fidelity generator does not accept parameter_constraints (see facebook/Ax#1639), so I removed them. I updated the tests to include outcome_constraints.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright! Thanks!

@delaossa delaossa self-requested a review February 5, 2024 12:35
They are currently not supported by the KG acquisition function.
@delaossa delaossa merged commit f741793 into main Feb 5, 2024
8 checks passed
@delaossa delaossa deleted the feature/add_constraints branch February 5, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants