@@ -105,7 +105,8 @@ train_model(model, opt, train_dl, val_dl, ydim; compiled_loss=my_compiled_loss)
105105"""
106106function train_model (model, opt_state, train_dl, val_dl, output_dim;
107107 max_epochs= 50 , patience= 10 , min_delta= 1e-4 , print_every= 100 ,
108- test_set= false , compute_loss= nothing , compiled_loss= masked_mse)
108+ test_set= false , compute_loss= nothing , compiled_loss= masked_mse,
109+ show_header= true )
109110
110111 # Build compute_loss from compiled_loss if not provided directly
111112 if isnothing (compute_loss) && ! isnothing (compiled_loss)
@@ -127,10 +128,12 @@ function train_model(model, opt_state, train_dl, val_dl, output_dim;
127128 val_losses = DEFAULT_FLOAT_TYPE[]
128129 val_r2_scores = DEFAULT_FLOAT_TYPE[]
129130
130- vprintln (VERBOSITY_NORMAL, " Starting training for up to $max_epochs epochs..." )
131- vprintln (VERBOSITY_NORMAL, " Early stopping: patience=$patience , min_delta=$min_delta " )
132- vprintln (VERBOSITY_NORMAL, " Batch size: $(train_dl. batchsize) , Total batches per epoch: $(length (train_dl)) " )
133- vprintln (VERBOSITY_NORMAL, " -" ^ 50 )
131+ if show_header
132+ vprintln (VERBOSITY_NORMAL, " Starting training for up to $max_epochs epochs..." )
133+ vprintln (VERBOSITY_NORMAL, " Early stopping: patience=$patience , min_delta=$min_delta " )
134+ vprintln (VERBOSITY_NORMAL, " Batch size: $(train_dl. batchsize) , Total batches per epoch: $(length (train_dl)) " )
135+ vprintln (VERBOSITY_NORMAL, " -" ^ 50 )
136+ end
134137
135138 for epoch in 1 : max_epochs
136139 # Train one epoch
0 commit comments