From 0f57179c8dd04681bd8109ef6580bdf11904348b Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Mon, 10 Jul 2023 14:25:58 -0500 Subject: [PATCH] snapshot... --- modules/deeplearning/cloud_opd_srcnn_abi.py | 33 +++++++++++---------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/modules/deeplearning/cloud_opd_srcnn_abi.py b/modules/deeplearning/cloud_opd_srcnn_abi.py index 6d328b52..167580c9 100644 --- a/modules/deeplearning/cloud_opd_srcnn_abi.py +++ b/modules/deeplearning/cloud_opd_srcnn_abi.py @@ -210,7 +210,7 @@ class SRCNN: self.test_label_files = None # self.n_chans = len(data_params_half) + len(data_params_full) + 1 - self.n_chans = 3 + self.n_chans = 5 self.X_img = tf.keras.Input(shape=(None, None, self.n_chans)) @@ -270,10 +270,11 @@ class SRCNN: tmp = normalize(tmp, param, mean_std_dct) data_norm.append(tmp) - tmp = input_label[:, label_idx_i, :, :] - tmp = np.where(np.isnan(tmp), 0, tmp) - tmp = normalize(tmp, 'refl_0_65um_nom', mean_std_dct) - data_norm.append(tmp[:, self.slc_y, self.slc_x]) + # High res refectance ---------- + # tmp = input_label[:, label_idx_i, :, :] + # tmp = np.where(np.isnan(tmp), 0, tmp) + # tmp = normalize(tmp, 'refl_0_65um_nom', mean_std_dct) + # data_norm.append(tmp[:, self.slc_y, self.slc_x]) tmp = input_label[:, label_idx_i, :, :] tmp = tmp.copy() @@ -297,16 +298,16 @@ class SRCNN: # tmp = np.where(np.isnan(tmp), 0.0, tmp) # data_norm.append(tmp) - # for param in sub_fields: - # idx = params.index(param) - # tmp = input_data[:, idx, :, :] - # tmp = upsample_nearest(tmp) - # tmp = tmp[:, self.slc_y, self.slc_x] - # if param != 'refl_substddev_ch01': - # tmp = normalize(tmp, 'refl_0_65um_nom', mean_std_dct) - # else: - # tmp = np.where(np.isnan(tmp), 0, tmp) - # data_norm.append(tmp) + for param in sub_fields: + idx = params.index(param) + tmp = input_data[:, idx, :, :] + tmp = upsample_nearest(tmp) + tmp = tmp[:, self.slc_y, self.slc_x] + if param != 'refl_substddev_ch01': + tmp = normalize(tmp, 'refl_0_65um_nom', mean_std_dct) + else: + tmp = np.where(np.isnan(tmp), 0, tmp) + data_norm.append(tmp) # --------------------------------------------------- data = np.stack(data_norm, axis=3) @@ -454,7 +455,7 @@ class SRCNN: self.loss = tf.keras.losses.MeanSquaredError() # Regression # decayed_learning_rate = learning_rate * decay_rate ^ (global_step / decay_steps) - initial_learning_rate = 0.002 + initial_learning_rate = 0.001 decay_rate = 0.95 steps_per_epoch = int(self.num_data_samples/BATCH_SIZE) # one epoch decay_steps = int(steps_per_epoch) * 4 -- GitLab