(self, epoch, minibatch)
Callback to handle SIGINT events.

        Arguments:
            epoch (int): index of current epoch
            minibatch (int): index of minibatch that is ending
Callback to handle SIGINT events.
Callback to handle SIGINT events .
def on_sigint_catch(self, epoch, minibatch):
        """
        Callback to handle SIGINT events.

        Arguments:
            epoch (int): index of current epoch
            minibatch (int): index of minibatch that is ending
        """
        # restore the orignal handler
        signal.signal(signal.SIGINT, signal.SIG_DFL)

        # save the model
        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
def on_sigint_catch ( self , epoch , minibatch ) : # restore the orignal handler signal . signal ( signal . SIGINT , signal . SIG_DFL ) # save the model 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