currently the framework opens a writer directly to the saved model on the filesystem - the first thing this does is truncate the target file. this create the precarious situation where the model state only exists in memory - if anything goes wrong during runtime the state could be at least partially lost.
a safer approach would be to serialised state to a temporary place and then overwrite the saved version when serialisation has completed successfully.
currently the framework opens a writer directly to the saved model on the filesystem - the first thing this does is truncate the target file. this create the precarious situation where the model state only exists in memory - if anything goes wrong during runtime the state could be at least partially lost.
a safer approach would be to serialised state to a temporary place and then overwrite the saved version when serialisation has completed successfully.