From 437f8030bc7cf6afbebb19f64e2c886dfbf2f7a0 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Mon, 9 Aug 2021 16:34:50 -0500 Subject: [PATCH] snapshot... --- modules/deeplearning/icing_cnn.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/deeplearning/icing_cnn.py b/modules/deeplearning/icing_cnn.py index d73948e4..5221e041 100644 --- a/modules/deeplearning/icing_cnn.py +++ b/modules/deeplearning/icing_cnn.py @@ -419,7 +419,7 @@ class IcingIntensityNN: momentum = 0.99 # num_filters = 16 - num_filters = 12 + num_filters = 24 conv = tf.keras.layers.Conv2D(num_filters, 5, strides=[1, 1], padding=padding, activation=activation)(self.inputs[0]) conv = tf.keras.layers.MaxPool2D(padding=padding)(conv) @@ -871,12 +871,16 @@ class IcingIntensityNN: return filename, ice_lons, ice_lats -def run_restore_static(filename_tst, ckpt_dir_s): +def run_restore_static(filename_tst, ckpt_dir_s_path): + ckpt_dir_s = os.listdir(ckpt_dir_s_path) cm_s = [] - for ckpt_dir in ckpt_dir_s: + for ckpt in ckpt_dir_s: + ckpt_dir = ckpt_dir_s_path + ckpt + if not os.path.isdir(ckpt_dir): + continue nn = IcingIntensityNN() nn.run_restore(filename_tst, ckpt_dir) - cm_s.append(tf.math.confusion_matrix(nn.test_labels, nn.test_preds)) + cm_s.append(tf.math.confusion_matrix(nn.test_labels.flatten(), nn.test_preds.flatten())) num = len(cm_s) cm_avg = cm_s[0] for k in range(num-1): -- GitLab