Skip to content

Commit

Permalink
Improve output msg
Browse files Browse the repository at this point in the history
small change in output
  • Loading branch information
hrue committed Oct 11, 2024
1 parent 5a3c286 commit b37143f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions gmrflib/domin-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ int GMRFLib_opt_estimate_hessian(double *hessian, double *x, double *log_dens_mo
if (!ISNAN(f0) && (ff0 > ff) && !early_stop) {
if (G.ai_par->fp_log || debug)
fprintf((G.ai_par->fp_log ? G.ai_par->fp_log : stderr),
"enable early_stop ff < f0: %f < %f (diff %g)\n", ff, ff0, ff - ff0);
"enable early_stop ff < f0: %f < %f (diff %g)\n", ff, ff0, ff0 - ff);
ff0 = ff;
early_stop = 1;
}
Expand Down Expand Up @@ -949,7 +949,8 @@ int GMRFLib_opt_estimate_hessian(double *hessian, double *x, double *log_dens_mo
if (CHECK_FOR_EARLY_STOP && (f11 < f_best_save) && !early_stop && enable_early_stop) {
if (G.ai_par->fp_log || debug)
fprintf((G.ai_par->fp_log ? G.ai_par->fp_log : stderr),
"enable early_stop f11 < f_best_save: %f < %f\n", f11, f_best_save);
"enable early_stop f11 < f_best_save: %f < %f (diff %f)\n",
f11, f_best_save, f_best_save - f11);
early_stop = 1;
continue;
}
Expand All @@ -959,7 +960,8 @@ int GMRFLib_opt_estimate_hessian(double *hessian, double *x, double *log_dens_mo
if (CHECK_FOR_EARLY_STOP && (f11 < f_best_save) && !early_stop && enable_early_stop) {
if (G.ai_par->fp_log || debug)
fprintf((G.ai_par->fp_log ? G.ai_par->fp_log : stderr),
"enable early_stop f11 < f_best_save: %f < %f\n", f11, f_best_save);
"enable early_stop f11 < f_best_save: %f < %f (diff %f)\n",
f11, f_best_save, f_best_save - f11);
early_stop = 1;
continue;
}
Expand All @@ -971,7 +973,8 @@ int GMRFLib_opt_estimate_hessian(double *hessian, double *x, double *log_dens_mo
if (CHECK_FOR_EARLY_STOP && (fm11 < f_best_save) && !early_stop && enable_early_stop) {
if (G.ai_par->fp_log || debug)
fprintf((G.ai_par->fp_log ? G.ai_par->fp_log : stderr),
"enable early_stop fm11 < f_best_save: %f < %f\n", fm11, f_best_save);
"enable early_stop fm11 < f_best_save: %f < %f (diff %f)\n",
fm11, f_best_save, f_best_save - fm11);
early_stop = 1;
continue;
}
Expand All @@ -983,7 +986,8 @@ int GMRFLib_opt_estimate_hessian(double *hessian, double *x, double *log_dens_mo
if (CHECK_FOR_EARLY_STOP && (f1m1 < f_best_save) && !early_stop && enable_early_stop) {
if (G.ai_par->fp_log || debug)
fprintf((G.ai_par->fp_log ? G.ai_par->fp_log : stderr),
"enable early_stop f1m1 < f_best_save: %f < %f\n", f1m1, f_best_save);
"enable early_stop f1m1 < f_best_save: %f < %f (diff %f)\n",
f1m1, f_best_save, f_best_save - f1m1);
early_stop = 1;
continue;
}
Expand All @@ -995,7 +999,8 @@ int GMRFLib_opt_estimate_hessian(double *hessian, double *x, double *log_dens_mo
if (CHECK_FOR_EARLY_STOP && (fm1m1 < f_best_save) && !early_stop && enable_early_stop) {
if (G.ai_par->fp_log || debug)
fprintf((G.ai_par->fp_log ? G.ai_par->fp_log : stderr),
"enable early_stop fm1m1 < f_best_save: %f < %f\n", fm1m1, f_best_save);
"enable early_stop fm1m1 < f_best_save: %f < %f (diff %f)\n",
fm1m1, f_best_save, f_best_save - fm1m1);
early_stop = 1;
continue;
}
Expand Down

0 comments on commit b37143f

Please sign in to comment.