From a7c3f766b0c0b358eb4eef5c3c7ec44346ca1bc3 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Wed, 23 Mar 2022 11:35:14 -0500 Subject: [PATCH] snapshot... --- modules/deeplearning/icing_fcn.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/deeplearning/icing_fcn.py b/modules/deeplearning/icing_fcn.py index 63e3d07e..5f045733 100644 --- a/modules/deeplearning/icing_fcn.py +++ b/modules/deeplearning/icing_fcn.py @@ -176,6 +176,7 @@ class IcingIntensityFCN: self.writer_train = None self.writer_valid = None + self.writer_train_valid_loss = None self.OUT_OF_RANGE = False @@ -817,6 +818,7 @@ class IcingIntensityFCN: self.writer_train = tf.summary.create_file_writer(os.path.join(logdir, 'plot_train')) self.writer_valid = tf.summary.create_file_writer(os.path.join(logdir, 'plot_valid')) + self.writer_train_valid_loss = tf.tf.summary.create_file_writer(os.path.join(logdir, 'plot_train_valid_loss')) step = 0 total_time = 0 @@ -877,6 +879,10 @@ class IcingIntensityFCN: tf.summary.scalar('num_train_steps', step, step=step) tf.summary.scalar('num_epochs', epoch, step=step) + with self.writer_train_valid_loss.as_default(): + tf.summary.scalar('loss_trn', loss.numpy(), step=step) + tf.summary.scalar('loss_val', self.test_loss.result(), step=step) + print('****** test loss, acc, lr: ', self.test_loss.result().numpy(), self.test_accuracy.result().numpy(), self.optimizer._decayed_lr('float32').numpy()) @@ -930,6 +936,7 @@ class IcingIntensityFCN: print('total time: ', total_time) self.writer_train.close() self.writer_valid.close() + self.writer_train_valid_loss.close() if self.h5f_l1b_trn is not None: self.h5f_l1b_trn.close() -- GitLab