pints icon indicating copy to clipboard operation
pints copied to clipboard

Set something up so that optimisation/inference can be stopped and restarted

Open MichaelClerx opened this issue 7 years ago • 6 comments

The ask-and-tell interface (#132) takes care of part of this, but it'd also be good to store the internal state of our optimisers/inferers to disk, perhaps using pickling ?

MichaelClerx avatar Jan 18 '18 14:01 MichaelClerx

#TODO: Have a quick look at https://pythonhosted.org/joblib/

MichaelClerx avatar Feb 20 '18 07:02 MichaelClerx

Meh

MichaelClerx avatar Feb 12 '19 07:02 MichaelClerx

@martinjrobins @ben18785 please add Freya to this ticket if she decides to take it up :-)

Rough idea of how to implement it:

  • write it as some kind of "deep copy" of every sampler/optimiser's state
  • add bits to the ask-and-tell interface that allow the current state to be obtained, and a previous state object to be restored
  • add a default implementation using copy.deepcopy
  • but make sure that copy.deepcopy is not required !
  • figure out what to do for wrapper methods i.e. cmaes

MichaelClerx avatar Sep 22 '20 11:09 MichaelClerx

@MichaelClerx : points 3 and 4 seem contradictory, what do you mean that copy.deepcopy is not required, its part of the standard library isn't it?

martinjrobins avatar Sep 22 '20 12:09 martinjrobins

Sorry, I meant that the interface shouldn't be written such that implementations require deepcopy. I.E. it should be possible to write a custom implementation instead

MichaelClerx avatar Sep 22 '20 12:09 MichaelClerx

Via a different route I've hit on https://joblib.readthedocs.io/en/latest/ again :D

MichaelClerx avatar Jul 14 '21 20:07 MichaelClerx