Skip to content
Snippets Groups Projects
Commit 656e752a authored by tomrink's avatar tomrink
Browse files

snapshot...

parent daadf416
Branches
No related tags found
No related merge requests found
......@@ -212,8 +212,7 @@ class SRCNN:
self.test_data_nda = None
self.test_label_nda = None
# self.n_chans = len(data_params) + 2
self.n_chans = 1
self.n_chans = len(data_params) + 1
self.X_img = tf.keras.Input(shape=(None, None, self.n_chans))
# self.X_img = tf.keras.Input(shape=(36, 36, self.n_chans))
......@@ -246,29 +245,20 @@ class SRCNN:
DO_ADD_NOISE = True
data_norm = []
# for param in data_params:
# idx = params.index(param)
# tmp = input_data[:, idx, :, :]
# tmp = np.where(np.isnan(tmp), 0, tmp)
# tmp = smooth_2d(tmp, sigma=1.0)
# tmp = tmp[:, slc_y_2, slc_x_2]
# tmp = resample_2d_linear(x_2, y_2, tmp, t, s)
# tmp = tmp[:, y_k, x_k]
# tmp = normalize(tmp, param, mean_std_dct)
# if DO_ADD_NOISE:
# tmp = add_noise(tmp, noise_scale=NOISE_STDDEV)
# data_norm.append(tmp)
# # --------------------------
# param = 'refl_0_65um_nom'
# idx = params.index(param)
# # tmp = input_data[:, idx, slc_y_2, slc_x_2]
# tmp = input_data[:, idx, slc_y, slc_x]
# tmp = normalize(tmp, param, mean_std_dct)
# if DO_ADD_NOISE:
# tmp = add_noise(tmp, noise_scale=NOISE_STDDEV)
# # tmp = resample_2d_linear(x_2, y_2, tmp, t, s)
# data_norm.append(tmp)
# --------
for param in data_params:
idx = params.index(param)
tmp = input_data[:, idx, :, :]
tmp = tmp.copy()
tmp = np.where(np.isnan(tmp), 0, tmp)
# tmp = smooth_2d(tmp, sigma=1.0)
tmp = tmp[:, slc_y_2, slc_x_2]
tmp = resample_2d_linear(x_2, y_2, tmp, t, s)
tmp = tmp[:, y_k, x_k]
tmp = normalize(tmp, param, mean_std_dct)
if DO_ADD_NOISE:
tmp = add_noise(tmp, noise_scale=NOISE_STDDEV)
data_norm.append(tmp)
# ---------------------------------------------------
tmp = input_data[:, label_idx, :, :]
tmp = tmp.copy()
tmp = np.where(np.isnan(tmp), 0, tmp)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment