Skip to content

Conversation

@benvanwerkhoven
Copy link
Collaborator

This pull adds support (again) for specifying an initial guess to the optimization algorithms. Currently, all support it except brute force, random search, and Bayesian optimization.

@sonarqubecloud
Copy link

@benvanwerkhoven
Copy link
Collaborator Author

Milo told me that he also tested this pull request and it worked for him. So I think we are ready to merge.

Copy link
Collaborator

@fjwillemsen fjwillemsen left a comment

Choose a reason for hiding this comment

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

Nice pull request, tests are passing.
The following should be addressed:

  • An exception (or warning) should be raised if x0 is provided with the incompatible strategies.
  • The greedy mls first_candidate code should be looked into, as it will currently never go into the else branch
  • Ideally, users should be able to provide multiple starting points. With Differential Evolution now custom, that should be possible.

#while searching
while fevals < max_fevals:
candidate = searchspace.get_random_sample(1)[0]
if first_candidate:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this doesn't do what you intend it to do, because cost_func.get_start_pos() always returns a configuration for x0, even if not provided by the user.

@benvanwerkhoven
Copy link
Collaborator Author

Great catch and suggestions! I've processed them, except for the passing of a population as x0. I have some ideas for larger changes in seeding initial populations, but that is for another time as it would be substantially more work.

…ion, implemented unsupported options check in Bayesian Optimization
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 4, 2025

Copy link
Collaborator

@fjwillemsen fjwillemsen left a comment

Choose a reason for hiding this comment

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

I've changed the test to make sure that strategies not supporting x0 actually raise an error, and implemented the unsupported options check in Bayesian Optimization.
The requested changes have been applied; tests passing - approved.

@benvanwerkhoven
Copy link
Collaborator Author

Awesome! Thanks!

@benvanwerkhoven benvanwerkhoven merged commit a48abc1 into master Jul 4, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants