stickeritis / sticker

Succeeded by SyntaxDot: https://github.com/tensordot/syntaxdot
Other
25 stars 2 forks source link

Split savers in separate data structures, add BestEpochSaver #148

Closed danieldk closed 4 years ago

danieldk commented 4 years ago

There used to be just one saver, SaveScheduler, with a SaveSchedule enum to decide the saving schedule. The problem with this approach is that the information that SaveScheduler had to keep track of increased with each new SaveSchedule.

This change defines a Save trait and splits the different schedules into separate saver data types that each implement the Save trait. Additionally, the BestEpochSaver schedule is added that only saves the model for an epoch when the model has improved over all previous epochs.

Fixes #65.


For now, I have left the pretrain schedule the same (though I still have to test it). I will later add a schedule that can be added to pretrain for only saving improved (on the validation data) batches.

danieldk commented 4 years ago

Fixed clippy unhappiness. Tested with pretraining, works as expected.