Browse Source

early stopping

new-sep-loss
Michael Pilosov 10 months ago
parent
commit
619dad2fe8
  1. 6
      main.py

6
main.py

@ -1,10 +1,10 @@
import argparse import argparse
import pytorch_lightning as pl import pytorch_lightning as pl
from pytorch_lightning.callbacks import EarlyStopping
from dataloader import create_named_dataloader from dataloader import create_named_dataloader
from model import ColorTransformerModel from model import ColorTransformerModel
from pytorch_lightning.callbacks import EarlyStopping
def parse_args(): def parse_args():
@ -44,10 +44,10 @@ def parse_args():
if __name__ == "__main__": if __name__ == "__main__":
args = parse_args() args = parse_args()
early_stop_callback = EarlyStopping( early_stop_callback = EarlyStopping(
monitor='hp_metric', # Metric to monitor monitor="hp_metric", # Metric to monitor
min_delta=0, # Minimum change in the monitored quantity to qualify as an improvement 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 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. mode="min", # Mode can be either 'min' for minimizing the monitored quantity or 'max' for maximizing it.
verbose=True, verbose=True,
) )

Loading…
Cancel
Save