From b36c278b0ceaff42c23b080f229596f4b01fd18e Mon Sep 17 00:00:00 2001 From: lruizcalico Date: Thu, 23 May 2024 19:28:13 -0700 Subject: [PATCH] add tensorboard writing --- src/baskerville/trainer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/baskerville/trainer.py b/src/baskerville/trainer.py index 44722fe..a9beeff 100644 --- a/src/baskerville/trainer.py +++ b/src/baskerville/trainer.py @@ -438,6 +438,7 @@ def eval_step1_distr(xd, yd): print(" Data %d" % di, end="") model = seqnn_model.models[di] with train_summary_writer.as_default(): + print("Write into train_summary_writer\n") tf.summary.scalar( "loss", train_loss[di].result().numpy(), step=ei ) @@ -464,6 +465,7 @@ def eval_step1_distr(xd, yd): eval_step1_distr(x, y) with valid_summary_writer.as_default(): + print("Write into valid_summary_writer\n") tf.summary.scalar( "loss", valid_loss[di].result().numpy(), step=ei ) @@ -643,6 +645,7 @@ def eval_step_distr(xd, yd): train_r2_epoch = train_r2.result().numpy() with train_summary_writer.as_default(): + print("Write into train_summary_writer\n") tf.summary.scalar("loss", train_loss_epoch, step=ei) tf.summary.scalar("r", train_r_epoch, step=ei) tf.summary.scalar("r2", train_r2_epoch, step=ei) @@ -665,6 +668,7 @@ def eval_step_distr(xd, yd): valid_r2_epoch = valid_r2.result().numpy() with valid_summary_writer.as_default(): + print("Write into valid_summary_writer\n") tf.summary.scalar("loss", valid_loss_epoch, step=ei) tf.summary.scalar("r", valid_r_epoch, step=ei) tf.summary.scalar("r2", valid_r2_epoch, step=ei)