Sklearn-genetic-opt icon indicating copy to clipboard operation
Sklearn-genetic-opt copied to clipboard

[FEATURE] Model checkpoint save/load

Open rodrigo-arenas opened this issue 10 months ago • 3 comments

It would be nice to enable saving and loading models checkpoints, this could help to control training the model in different sessions in case is a large model, as well as keeping a copy of the model in case of some error during the training time

I open this issue for contributors

This Issue requests the following features:

Describe the solution you'd expect

  • Enable saving model checkpoints as a callback named ModelCheckpoint that takes as an argument the location to save the model
  • The checkpoints should save the training status and the logbook object, you can make use of the already implemented class LogbookSaver
  • Implement save and load methods in GASearchCV and GAFeatureSelectionCV
  • When calling the fit method, it should resume the training where it was left by default
  • Enable an option to start the training again (from generation 0) but with starting point (i.e hyperparameters or features) the best ones found so far in the saved model

Additional context You can check TensorFlow save and load weights methods as an inspiration

rodrigo-arenas avatar Aug 09 '23 02:08 rodrigo-arenas

I would like to work on this, is that alright?

cpparnell avatar Oct 18 '23 03:10 cpparnell

Hi @cpparnell sure, you can work on it, thanks

rodrigo-arenas avatar Oct 18 '23 13:10 rodrigo-arenas

@rodrigo-arenas I have some questions about the last two bullet points:

  • When calling the fit method, it should resume the training where it was left by default
  • Enable an option to start the training again (from generation 0) but with starting point (i.e hyperparameters or features) the best ones found so far in the saved model

Should there be an option provided to the fit method to start training again? Or should the functionality described above be implemented within the ModelCheckpoint callback?

Do you mean that I should be able to use the load method to load from the checkpoint path, similar to what is described in TensorFlow's ModelCheckpoint?

cpparnell avatar Oct 25 '23 21:10 cpparnell