From 94509fa9bf05aa08347e1a05c8021addd53161a2 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Tue, 14 Mar 2023 11:48:41 -0500
Subject: [PATCH] snapshot...

---
 modules/deeplearning/cnn_cld_frac_mod_res.py | 32 ++------------------
 1 file changed, 3 insertions(+), 29 deletions(-)

diff --git a/modules/deeplearning/cnn_cld_frac_mod_res.py b/modules/deeplearning/cnn_cld_frac_mod_res.py
index 1e6aa4c5..aff1f2a5 100644
--- a/modules/deeplearning/cnn_cld_frac_mod_res.py
+++ b/modules/deeplearning/cnn_cld_frac_mod_res.py
@@ -21,7 +21,7 @@ LOG_DEVICE_PLACEMENT = False
 PROC_BATCH_SIZE = 4
 PROC_BATCH_BUFFER_SIZE = 5000
 
-NumClasses = 3
+NumClasses = 5
 if NumClasses == 2:
     NumLogits = 1
 else:
@@ -37,7 +37,7 @@ NOISE_TRAINING = False
 NOISE_STDDEV = 0.01
 DO_AUGMENT = True
 
-DO_SMOOTH = True
+DO_SMOOTH = False
 SIGMA = 1.0
 DO_ZERO_OUT = False
 DO_ESPCN = False  # Note: If True, cannot do mixed resolution input fields (Adjust accordingly below)
@@ -275,15 +275,6 @@ class SRCNN:
 
         self.OUT_OF_RANGE = False
 
-        # self.abi = None
-        # self.temp = None
-        # self.wv = None
-        # self.lbfp = None
-        # self.sfc = None
-
-        # self.in_mem_data_cache = {}
-        # self.in_mem_data_cache_test = {}
-
         self.model = None
         self.optimizer = None
         self.ema = None
@@ -314,11 +305,6 @@ class SRCNN:
         self.test_data_files = None
         self.test_label_files = None
 
-        # self.train_data_nda = None
-        # self.train_label_nda = None
-        # self.test_data_nda = None
-        # self.test_label_nda = None
-
         # self.n_chans = len(data_params_half) + len(data_params_full) + 1
         self.n_chans = 5
 
@@ -366,10 +352,6 @@ class SRCNN:
         # input_data = np.concatenate(data_s)
         # input_label = np.concatenate(label_s)
 
-        DO_ADD_NOISE = False
-        if is_training and NOISE_TRAINING:
-            DO_ADD_NOISE = True
-
         data_norm = []
         for param in data_params_half:
             idx = params.index(param)
@@ -381,8 +363,6 @@ class SRCNN:
                 tmp = get_grid_cell_mean(tmp)
                 tmp = tmp[:, 0:66, 0:66]
             tmp = normalize(tmp, param, mean_std_dct)
-            if DO_ADD_NOISE:
-                tmp = add_noise(tmp, noise_scale=NOISE_STDDEV)
             data_norm.append(tmp)
 
         for param in data_params_full:
@@ -412,13 +392,7 @@ class SRCNN:
             tmp = tmp[:, 0:66, 0:66]
         if label_param != 'cloud_probability':
             tmp = normalize(tmp, label_param, mean_std_dct)
-            if DO_ADD_NOISE:
-                tmp = add_noise(tmp, noise_scale=NOISE_STDDEV)
-        else:
-            if DO_ADD_NOISE:
-                tmp = add_noise(tmp, noise_scale=NOISE_STDDEV)
-                tmp = np.where(tmp < 0.0, 0.0, tmp)
-                tmp = np.where(tmp > 1.0, 1.0, tmp)
+
         data_norm.append(tmp)
         # ---------
         data = np.stack(data_norm, axis=3)
-- 
GitLab