I am using keras tuner to serach for hyperparameters. If there are no improvement after certain number of trials then I would like to stop searching. Is it possible to do via callback fucntion?
class EarlySearchStop(Callback):
def __init__(self, patience=5):
super(EarlySearchStop, self).__init__()
self.patience = patience
self.best_metric = float('inf')
self.wait = 0
def on_train_end(self, logs=None):
if some_global_minimum < self.best_metric:
stop_searching_toomuch()
So far, I can stop "a trial" on epoch end. However, I am looking to stop the whole search space.