From 005381d97a57f5c580dbe9d917a07a320beaf5d9 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Sat, 8 Apr 2023 15:07:49 -0500
Subject: [PATCH] make 3 class now

---
 modules/deeplearning/cloud_fraction_fcn.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/modules/deeplearning/cloud_fraction_fcn.py b/modules/deeplearning/cloud_fraction_fcn.py
index b4f797b6..14e58ec8 100644
--- a/modules/deeplearning/cloud_fraction_fcn.py
+++ b/modules/deeplearning/cloud_fraction_fcn.py
@@ -15,7 +15,7 @@ LOG_DEVICE_PLACEMENT = False
 PROC_BATCH_SIZE = 4
 PROC_BATCH_BUFFER_SIZE = 5000
 
-NumClasses = 5
+NumClasses = 3
 if NumClasses == 2:
     NumLogits = 1
 else:
@@ -172,6 +172,7 @@ def get_label_data(grd_k):
 
 def get_label_data_5cat(grd_k):
     grd_k = np.where(np.isnan(grd_k), 0, grd_k)
+    # grd_u = np.where(np.logical_and(grd_k > 0.45, grd_k < 0.55), 1, 0)
     grd_k = np.where(grd_k < 0.5, 0, 1)
 
     a = grd_k[:, 0::2, 0::2]
@@ -192,8 +193,17 @@ def get_label_data_5cat(grd_k):
     s[cat_3] = 3
     s[cat_4] = 4
 
+    # a = grd_u[:, 0::2, 0::2]
+    # b = grd_u[:, 1::2, 0::2]
+    # c = grd_u[:, 0::2, 1::2]
+    # d = grd_u[:, 1::2, 1::2]
+    # s_u = a + b + c + d
+    # cat_u = (s_u == 4)
+    # s[cat_u] = 5
+
     return s
 
+
 class SRCNN:
     
     def __init__(self):
-- 
GitLab