diff --git a/modules/deeplearning/icing_fcn.py b/modules/deeplearning/icing_fcn.py index 63e3d07e9a2c6e50a7ffda8b9f578231950e9223..5f0457332b9364beae2ea6181635509b4cf2ced2 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()