-
Notifications
You must be signed in to change notification settings - Fork 9
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
[FEATURE] Option to pickle the whole strategy #2
Comments
Hi Alex, I chose the |
@RobertTLange I think your proposal sounds good. I guess you could also consider whether people would want both? So there's an Regarding your second question I was curious and had a look around (for example: https://stackoverflow.com/questions/21998007/python-avoid-defining-both-a-classmethod-and-an-instancemethod) and it seems the "right" way to do that would simply be to have a module level function called If you go with that, perhaps the load method would need a more descriptive name? Like |
Another thing to consider is that maybe people can just pickle it themselves... lol. Unless you're doing other checks (on top of simple pickling unpickling the standard way), maybe it's too trivial to implement. |
Sorry for the long wait. I just addressed your request in PR #5. You can now save the state of your strategy as a pickle file as follows: strategy = RandomSearch(...)
# Explicitly call `save` method
strategy.save("<pkl_filename>.pkl")
# ... or save the strategy with a `tell` call
strategy.tell(configs, scores, save=True, save_fname="<pkl_filename>.pkl") You can then reload the log using mle-hyperopt/mle_hyperopt/strategy.py Line 266 in d72a400
It will be part of the next release (hopefully coming soon -- I am pretty excited about the new |
Right now
strategy.save
produces a JSON with the log. Any reason you didn't opt for (or have an option of) pickling the whole strategy? Two motivations for this:The text was updated successfully, but these errors were encountered: