From f86261c0b6a02750c778595725d2b88e57a6e2cd Mon Sep 17 00:00:00 2001 From: Michael <m.langguth@fz-juelich.de> Date: Thu, 19 Aug 2021 07:33:44 +0200 Subject: [PATCH] Make set_model_saver_flag-method more verbose. --- video_prediction_tools/main_scripts/main_train_models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/video_prediction_tools/main_scripts/main_train_models.py b/video_prediction_tools/main_scripts/main_train_models.py index 08202678..0b91b181 100644 --- a/video_prediction_tools/main_scripts/main_train_models.py +++ b/video_prediction_tools/main_scripts/main_train_models.py @@ -469,12 +469,17 @@ class TrainModel(object): :return flag: True if model should be saved :return loss_avg: updated minimum loss """ + method = TrainModel.set_model_saver_flag.__name__ + save_flag = False if len(losses) <= niter_steps*2: loss_avg = old_min_loss return save_flag, loss_avg loss_avg = np.mean(losses[-niter_steps:]) + # print diagnosis + print("%{0}: Current loss: {1:.4f}, old minimum: {2:.4f}, model will be saved: {3}" + .format(method, loss_avg, old_min_loss, loss_avg < old_min_loss)) if loss_avg < old_min_loss: save_flag = True else: -- GitLab