This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EarlyStop: | |
""" | |
Early stops the training if validation loss doesn't improve after a given patience. | |
""" | |
def __init__(self, patience=10, verbose=False, delta=0, mode='min'): | |
""" | |
Args: | |
patience (int): How long to wait after last time validation loss improved. | |
Default: 10 | |
verbose (bool): If True, prints a message for each validation loss improvement. |