Skip to content
Snippets Groups Projects
Commit a7c3f766 authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 68933c07
No related branches found
No related tags found
No related merge requests found
...@@ -176,6 +176,7 @@ class IcingIntensityFCN: ...@@ -176,6 +176,7 @@ class IcingIntensityFCN:
self.writer_train = None self.writer_train = None
self.writer_valid = None self.writer_valid = None
self.writer_train_valid_loss = None
self.OUT_OF_RANGE = False self.OUT_OF_RANGE = False
...@@ -817,6 +818,7 @@ class IcingIntensityFCN: ...@@ -817,6 +818,7 @@ class IcingIntensityFCN:
self.writer_train = tf.summary.create_file_writer(os.path.join(logdir, 'plot_train')) 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_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 step = 0
total_time = 0 total_time = 0
...@@ -877,6 +879,10 @@ class IcingIntensityFCN: ...@@ -877,6 +879,10 @@ class IcingIntensityFCN:
tf.summary.scalar('num_train_steps', step, step=step) tf.summary.scalar('num_train_steps', step, step=step)
tf.summary.scalar('num_epochs', epoch, 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(), print('****** test loss, acc, lr: ', self.test_loss.result().numpy(), self.test_accuracy.result().numpy(),
self.optimizer._decayed_lr('float32').numpy()) self.optimizer._decayed_lr('float32').numpy())
...@@ -930,6 +936,7 @@ class IcingIntensityFCN: ...@@ -930,6 +936,7 @@ class IcingIntensityFCN:
print('total time: ', total_time) print('total time: ', total_time)
self.writer_train.close() self.writer_train.close()
self.writer_valid.close() self.writer_valid.close()
self.writer_train_valid_loss.close()
if self.h5f_l1b_trn is not None: if self.h5f_l1b_trn is not None:
self.h5f_l1b_trn.close() self.h5f_l1b_trn.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment