improved early stoppping

This commit is contained in:
Falko Victor Habel 2025-02-25 19:47:18 +01:00
parent 2e1556d306
commit 7fd2af6f12
2 changed files with 3 additions and 2 deletions

View File

@ -11,7 +11,7 @@ from torchvision import transforms
class UpscaleDataset(Dataset):
def __init__(self, parquet_files: list, transform=None, samples_per_file=2500):
def __init__(self, parquet_files: list, transform=None, samples_per_file=5000):
combined_df = pd.DataFrame()
for parquet_file in parquet_files:
# Load a subset from each parquet file

View File

@ -260,7 +260,8 @@ class aiuNNTrainer:
torch.cuda.empty_cache()
# Check early stopping
if early_stopping(val_loss if self.validation_loader else avg_train_loss):
early_stopping(val_loss if self.validation_loader else avg_train_loss)
if early_stopping.early_stop:
print(f"Early stopping triggered at epoch {epoch + 1}")
break