From 619dad2fe8db79fc6288113d8550ba68fce8bb45 Mon Sep 17 00:00:00 2001 From: Michael Pilosov Date: Sun, 14 Jan 2024 07:28:48 +0000 Subject: [PATCH] early stopping --- main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index a78f21b..0161274 100644 --- a/main.py +++ b/main.py @@ -1,10 +1,10 @@ import argparse import pytorch_lightning as pl +from pytorch_lightning.callbacks import EarlyStopping from dataloader import create_named_dataloader from model import ColorTransformerModel -from pytorch_lightning.callbacks import EarlyStopping def parse_args(): @@ -44,10 +44,10 @@ def parse_args(): if __name__ == "__main__": args = parse_args() early_stop_callback = EarlyStopping( - monitor='hp_metric', # Metric to monitor - min_delta=0, # Minimum change in the monitored quantity to qualify as an improvement - patience=50, # Number of epochs with no improvement after which training will be stopped - mode='min', # Mode can be either 'min' for minimizing the monitored quantity or 'max' for maximizing it. + monitor="hp_metric", # Metric to monitor + min_delta=0, # Minimum change in the monitored quantity to qualify as an improvement + patience=50, # Number of epochs with no improvement after which training will be stopped + mode="min", # Mode can be either 'min' for minimizing the monitored quantity or 'max' for maximizing it. verbose=True, )