diff --git a/modules/deeplearning/icing_cnn.py b/modules/deeplearning/icing_cnn.py index d73948e47a00e8fbb4c750a044b6a4d1667d6326..5221e041c2ec230b2c010ccdca82dba44affb5cc 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):