Open DawnEve opened 4 years ago
for i in range(6): [i, i+3) 0 3 1 4 2 5 3 6 4 7 [5, 8) # this last slice shouldn't be neglected.
hidden_size = ((input_rows - kernel_rows+1) (input_cols - kernel_cols+1)) num_kernels
for row_start in range(layer_0.shape[1]-kernel_rows+1): for col_start in range(layer_0.shape[2] - kernel_cols+1): sect = get_image_section(layer_0, row_start, row_start+kernel_rows, col_start, col_start+kernel_cols) it works
8x8 image with a 3x3 kernel, we get 6x6 output, which means 8-3+1=6.
when using
for row_start in range(layer_0.shape[1]-kernel_rows)
, it discards the last pixel in the row.What do you think?