Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can I pause and restart the optimization? #6

Closed
zxjroger opened this issue May 3, 2022 · 1 comment
Closed

Can I pause and restart the optimization? #6

zxjroger opened this issue May 3, 2022 · 1 comment

Comments

@zxjroger
Copy link

zxjroger commented May 3, 2022

Hi, thank you for this amazing package. I was wondering if there is a way to pause the optimization and save the progress, then restart it? Thank you.

@jbrea
Copy link
Owner

jbrea commented Jun 18, 2022

Sorry, this slipped my attention.

Yes, you can use the internal function CMAEvolutionStrategy.run!(o, f), e.g.

function rosenbrock(x)
    n = length(x)
    sum(100 * (x[2i-1]^2 - x[2i])^2 + (x[2i-1] - 1)^2 for i in 1:div(n, 2))
end
result = minimize(rosenbrock, zeros(6), 1., maxfevals = 100)
result.stop.maxfevals = 200
CMAEvolutionStrategy.run!(result, rosenbrock)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants