diff --git a/modules/deeplearning/cnn_cld_frac.py b/modules/deeplearning/cnn_cld_frac.py index f408659d938ba7d5c3d73c2adeccf76bd311a515..fc1b56275b1a2f44a87a194aa6369832580dcbcf 100644 --- a/modules/deeplearning/cnn_cld_frac.py +++ b/modules/deeplearning/cnn_cld_frac.py @@ -313,10 +313,12 @@ class CNN: def get_label_data(self, grd_k): num, leny, lenx = grd_k.shape - grd_down_2x = np.zeros((num, leny, lenx)) + leny_d2x = int(leny / 2) + lenx_d2x = int(lenx / 2) + grd_down_2x = np.zeros((num, leny_d2x, lenx_d2x)) for t in range(num): - for j in range(int(leny / 2)): - for i in range(int(lenx / 2)): + for j in range(leny_d2x): + for i in range(lenx_d2x): cell = grd_k[t, j:j + 2, i:i + 2] if np.sum(np.isnan(cell)) == 0: cnt = np.sum(cell) @@ -450,14 +452,12 @@ class CNN: conv = input_2d print('input: ', conv.shape) - conv = conv_b = tf.keras.layers.Conv2D(num_filters, kernel_size=2, strides=1, kernel_initializer='he_uniform', activation=activation, padding='SAME')(input_2d) + conv = conv_b = tf.keras.layers.Conv2D(num_filters, kernel_size=2, strides=2, kernel_initializer='he_uniform', activation=activation, padding='SAME')(input_2d) print(conv.shape) if NOISE_TRAINING: conv = conv_b = tf.keras.layers.GaussianNoise(stddev=NOISE_STDDEV)(conv) - scale = 0.2 - conv_b = build_residual_block_1x1(conv_b, num_filters, activation, 'Residual_Block_1') conv_b = build_residual_block_1x1(conv_b, num_filters, activation, 'Residual_Block_2')