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

ax.dev, GitHub readme, and loop tutorial examples are ignoring minimize kwarg #2248

Closed
sgbaird opened this issue Mar 5, 2024 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@sgbaird
Copy link
Contributor

sgbaird commented Mar 5, 2024

@jwatchorn pointed out to me that the example from https://ax.dev/, the GitHub readme, and the Loop API tutorial are ignoring the minimize kwarg and maximizing it instead (note these are loop API examples). I assume this is related to the deprecation of the minimize kwarg in the context of the Service API.

See this reproducer: https://colab.research.google.com/drive/1iEUgDgFO7K_B6fYSSf9YSFOacCaKvk7u?usp=sharing

from ax import optimize
best_parameters, best_values, experiment, model = optimize(
      parameters=[
        {
          "name": "x1",
          "type": "range",
          "bounds": [-10.0, 10.0],
        },
        {
          "name": "x2",
          "type": "range",
          "bounds": [-10.0, 10.0],
        },
      ],
      # Booth function
      evaluation_function=lambda p: (p["x1"] + 2*p["x2"] - 7)**2 + (2*p["x1"] + p["x2"] - 5)**2,
      minimize=True,
  )
print(best_parameters)
# {'x1': -10.0, 'x2': -10.0}
print(best_values)
# ({'objective': 2593.8262505563807}, {'objective': {'objective': 10.51208881969219}})
@bernardbeckerman
Copy link
Contributor

Thanks for this great writeup with repro as usual @sgbaird! Taking a look now.

@bernardbeckerman bernardbeckerman self-assigned this Mar 5, 2024
@bernardbeckerman bernardbeckerman added the bug Something isn't working label Mar 5, 2024
@bernardbeckerman
Copy link
Contributor

This is a bug! And the fix is up : ) (link) Thanks for this detailed report - made it super easy to find + fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants