-
Notifications
You must be signed in to change notification settings - Fork 11
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
Random local search over a set of permissible values #374
base: master
Are you sure you want to change the base?
Conversation
2f6ee3b
to
7865a93
Compare
(CI-check fail seems like an unrelated mypy issue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great stuff, thanks for working on this! 🚀
I left a few comments, please address them before we merge this
objective: Callable, | ||
seed: int, | ||
n_steps: int = 10, # todo: should this be dependent on the number of parameters? | ||
permissible_values: np.ndarray = np.logspace(start=0, stop=7, num=8, base=2, dtype=int), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the current implementation, is it, for example, possible to say "parameters should be uniformly sampled in the interval [0, 1]"? if not, I think it would be a good idea to make the generation of permissible values modular to support such use cases
params=params_sampled, params_names=params_names | ||
) | ||
# evaluate fitness | ||
self.objective(new_ind) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed, the local-search objective should not modify individuals but return a fitness value
ind.fitness = new_ind.fitness | ||
|
||
|
||
if __name__ == "__main__": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rest should be moved into a test I guess ;)
Addresses #373. This is based on an implementation I used in a project with hal-cgp, thus the default values for
permissible-values
. There is two open questions, marked as todo in the code comments.For convenience i put a short example at the end. I can extend this to a full example before merging or remove it.