I am using Keras 2.2.4 and normally I use the Keras EarlyStopping callback to halt training while ensuring that the best weights observed during that training are returned. So, I have something like the following:
stop_early = keras.callbacks.EarlyStopping(
monitor = 'val_loss',
min_delta = 0.0001,
patience = 300,
verbose = 1,
mode = 'auto',
baseline = None,
restore_best_weights = True
)
What would be some way I could get Keras to halt the training and to return the best weights, as though the criteria given to EarlyStopping had been met? I have in mind the idea that there could be some callback a bit like EarlyStopping that checks routinely for the existence of some file, e.g. safeword, at the working directory. How might this or similar be done?