support graceful training cleanup after Keyboard Interrupt
🚀 Feature
In the training loop, we should catch KeyboardInterrupt exceptions and enter a graceful termination (ie. run on_training_end, print profiler report, etc).
Motivation
Sometimes I'll train a model and just let it run until something interesting happens or my loss has converged. Exiting via "Ctrl + C" can be easier than waiting for "EarlyStopping" to trigger in some cases. However, I may still want certain things to occur (eg. printing out the profiler summary) after stopping training.
Salesforce's AWD-LSTM has an example of this feature implemented here.
Pitch
Figure out what actions we want to run after a KeyboardInterrupt. Then adjust the training loop to catch this exception and ensure the aforementioned actions still run afterwards.