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

Feeding in solutions from a previous optimisation run #242

Closed
trbedwards opened this issue Nov 8, 2023 · 1 comment
Closed

Feeding in solutions from a previous optimisation run #242

trbedwards opened this issue Nov 8, 2023 · 1 comment

Comments

@trbedwards
Copy link

I have a previous optimisation run that I would like to feed in solutions and function values from, to give CMA-ES a warm-start. This previous optimisation might not have necessarily been run using pycma.

Is there a way to do this? I've tried to use inject(x_best) from my best solution so far but after calling a few asks and tells, it throws the following error:
ValueError: Found unused injected direction/solutions

@nikohansen
Copy link
Contributor

nikohansen commented Nov 8, 2023

Generally, this is what the arguments X0 and sigma are for. If we assume X0 is already a pretty good guess, we use a small value for sigma.

When a full run from CMA-ES should be continued, the feed_for_resume method is supposed to "re-create" a previous run from solutions and f-values, however see also #240, which is also "directly" possible using the ask-and-tell interface. These depend on the population size popsize of the current CMA-ES instance to be the same as the one how the data were generated. If the solutions to be fed were not sampled during a run from CMA-ES, this is bound to fail, because the algorithm assumes a particular sample distribution. In this case passing the found best guess as initial solution with a small initial step-size seems the best approach.

Specifically, it's hard to understand the above error without additional information. Having the calling code to be used would be a first step. Generally, it should be possible to inject one or a few solutions in each iteration with the inject method without getting an error (depending on popsize).

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

No branches or pull requests

2 participants