gugarosa / opytimizer

🐦 Opytimizer is a Python library consisting of meta-heuristic optimization algorithms.
https://opytimizer.readthedocs.io
Apache License 2.0
606 stars 41 forks source link

[NEW] Dump optimization progress #16

Closed gcoimbra closed 3 years ago

gcoimbra commented 3 years ago

Is your feature request related to a problem? Please describe. If the server running fails. We lose the time running.

Describe the solution you'd like Dump the optimization object from a time to time.

Describe alternatives you've considered Maybe dump the agents?

gugarosa commented 3 years ago

Actually, this package is not intended to be deployed in production-ready environments nor servers, as its construction was designed to fulfill experimentation and research-based tasks. Additionally, each iteration already dumps the agents, which is controlled by the store_best_only argument on Opytimizer.start() method. Though the history object is only available at the end of the optimization.

While the logs already provide an outline of the optimization procedure, even if the process is suddenly stopped, I do understand your concern.

We do belive that such an idea would be better implemented as an approach that enables a halting in the optimization process and its restarting at a future time. I guess this would be the apex of both worlds as users would be able to have a current snapshot of their process and re-use it whenever they want.

I have added such an issue to our roadmap and I will take a deeper look into it.

Best regards, Gustavo.

gcoimbra commented 3 years ago

Thanks for the comprehensive answer Gustavo.

Yes it would be better if we could resume the optimization process. Or even if it finished, make it go some iterations more. Which I think would be even better because the user itself can persist the model from time to time if it is needed.

I actually didn't know about that option. But it actually serves me well right now. Thanks!

I think I should keep the issue open but feel free to close as you've added it to the roadmap

gugarosa commented 3 years ago

Hello Gabriel! I hope everything is all right with you.

With the upcoming version (3.0.0), you will be able to checkpoint the optimization and resume it as intended. Please take a look at:

It is still under development, yet it is already working. It will take a few days/weeks to be merged into master and be released into PyPI.

Best regards, Gustavo.

gcoimbra commented 3 years ago

@gugarosa . First of all, I'm fine. I hope you are too. Thank you for this feature. It will be very useful, I hope not just for me, but everyone using opytimizer!