diff --git a/modules/deeplearning/cloud_opd_fcn_abi.py b/modules/deeplearning/cloud_opd_fcn_abi.py index 9ac85b9f7a0ec7130cfebbcb0131bdbcccaccfdb..9280e9b07e56a98ac4cbdd02ab35ef8f801a5f34 100644 --- a/modules/deeplearning/cloud_opd_fcn_abi.py +++ b/modules/deeplearning/cloud_opd_fcn_abi.py @@ -1,6 +1,7 @@ import tensorflow as tf from util.plot_cm import confusion_matrix_values +from util.augment import augment_image from util.setup_cloud_fraction import logdir, modeldir, now, ancillary_path from util.util import EarlyStop, normalize, denormalize, get_grid_values_all import glob @@ -502,23 +503,11 @@ class SRCNN: self.initial_learning_rate = initial_learning_rate def build_evaluation(self): + self.train_accuracy = tf.keras.metrics.MeanAbsoluteError(name='train_accuracy') + self.test_accuracy = tf.keras.metrics.MeanAbsoluteError(name='test_accuracy') self.train_loss = tf.keras.metrics.Mean(name='train_loss') self.test_loss = tf.keras.metrics.Mean(name='test_loss') - if NumClasses == 2: - self.train_accuracy = tf.keras.metrics.BinaryAccuracy(name='train_accuracy') - self.test_accuracy = tf.keras.metrics.BinaryAccuracy(name='test_accuracy') - self.test_auc = tf.keras.metrics.AUC(name='test_auc') - self.test_recall = tf.keras.metrics.Recall(name='test_recall') - self.test_precision = tf.keras.metrics.Precision(name='test_precision') - self.test_true_neg = tf.keras.metrics.TrueNegatives(name='test_true_neg') - self.test_true_pos = tf.keras.metrics.TruePositives(name='test_true_pos') - self.test_false_neg = tf.keras.metrics.FalseNegatives(name='test_false_neg') - self.test_false_pos = tf.keras.metrics.FalsePositives(name='test_false_pos') - else: - self.train_accuracy = tf.keras.metrics.SparseCategoricalAccuracy(name='train_accuracy') - self.test_accuracy = tf.keras.metrics.SparseCategoricalAccuracy(name='test_accuracy') - @tf.function(input_signature=[tf.TensorSpec(None, tf.float32), tf.TensorSpec(None, tf.float32)]) def train_step(self, inputs, labels): labels = tf.squeeze(labels, axis=[3])