'Convenience function to create and add an early stopping callback.
Arguments:
stop_func (function): function to determine when to stop.'

def add_early_stop_callback(self, stop_func):

    self.add_callback(EarlyStopCallback(stop_func))
