From df612ef570f5e7940ba41c09a2e96869bacd3067 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Sun, 14 Aug 2022 22:05:22 -0500
Subject: [PATCH] snapshot...

---
 modules/deeplearning/espcn.py | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/modules/deeplearning/espcn.py b/modules/deeplearning/espcn.py
index 8e41c165..362f4483 100644
--- a/modules/deeplearning/espcn.py
+++ b/modules/deeplearning/espcn.py
@@ -61,8 +61,10 @@ label_param = label_params[label_idx]
 
 x_70 = np.arange(70)
 y_70 = np.arange(70)
-x_70_2 = x_70[3:67:2]
-y_70_2 = y_70[3:67:2]
+#x_70_2 = x_70[3:67:2]
+#y_70_2 = y_70[3:67:2]
+x_70_2 = x_70[2:68:2]
+y_70_2 = y_70[2:68:2]
 
 
 def build_residual_conv2d_block(conv, num_filters, block_name, activation=tf.nn.leaky_relu, padding='SAME'):
@@ -177,7 +179,7 @@ class ESPCN:
 
         self.X_img = tf.keras.Input(shape=(None, None, self.n_chans))
         # self.X_img = tf.keras.Input(shape=(36, 36, self.n_chans))
-        self.X_img = tf.keras.Input(shape=(32, 32, self.n_chans))
+        # self.X_img = tf.keras.Input(shape=(34, 34, self.n_chans))
         # self.X_img = tf.keras.Input(shape=(66, 66, self.n_chans))
 
         self.inputs.append(self.X_img)
@@ -204,8 +206,8 @@ class ESPCN:
         data = np.expand_dims(data, axis=3)
 
         # label = label[:, label_idx, :, :]
-        # label = label[:, label_idx, 3:67:2, 3:67:2]
-        label = label[:, label_idx, 3:67, 3:67]
+        label = label[:, label_idx, 3:67:2, 3:67:2]
+        # label = label[:, label_idx, 3:67, 3:67]
         label = np.expand_dims(label, axis=3)
 
         data = data.astype(np.float32)
@@ -349,8 +351,8 @@ class ESPCN:
         conv = input_2d
         print('input: ', conv.shape)
 
-        conv = conv_b = tf.keras.layers.Conv2D(num_filters, kernel_size=3, padding=padding)(input_2d)
-        # conv = conv_b = tf.keras.layers.Conv2D(num_filters, kernel_size=3, padding='VALID')(input_2d)
+        # conv = conv_b = tf.keras.layers.Conv2D(num_filters, kernel_size=3, padding=padding)(input_2d)
+        conv = conv_b = tf.keras.layers.Conv2D(num_filters, kernel_size=3, padding='VALID')(input_2d)
         print(conv.shape)
 
         if NOISE_TRAINING:
@@ -369,11 +371,10 @@ class ESPCN:
         conv = conv + conv_b
         print(conv.shape)
 
-        conv = tf.keras.layers.Conv2D(num_filters * (factor ** 2), 3, padding='same')(conv)
-        # conv = tf.keras.layers.Conv2D((factor ** 2), 3, padding='same')(conv)
+        # conv = tf.keras.layers.Conv2D(num_filters * (factor ** 2), 3, padding='same')(conv)
         print(conv.shape)
 
-        conv = tf.nn.depth_to_space(conv, factor)
+        #conv = tf.nn.depth_to_space(conv, factor)
         print(conv.shape)
 
         self.logits = tf.keras.layers.Conv2D(1, kernel_size=3, strides=1, padding=padding, name='regression')(conv)
-- 
GitLab