'Callback to handle SIGINT events.
Arguments:
epoch (int): index of current epoch
minibatch (int): index of minibatch that is ending'

def on_sigint_catch(self, epoch, minibatch):

    signal.signal(signal.SIGINT, signal.SIG_DFL)
    if (self.save_path is not None):
        save_obj(self.model().serialize(keep_states=True), self.save_path)
        raise KeyboardInterrupt('Checkpoint    file    saved    to    {0}'.format(self.save_path))
    else:
        raise KeyboardInterrupt
