為什麼要使用reshape
2019/09/08 09:05 下午
機器學習共學討論版
蕭琮寶
觀看數:19
回答數:2
收藏數:0
ml100-2-d96
ml100-2
if K.image_data_format() == 'channels_first':
x_train = x_train.reshape(x_train.shape[0], 1, img_rows, img_cols)
x_test = x_test.reshape(x_test.shape[0], 1, img_rows, img_cols)
input_shape = (1, img_rows, img_cols)
else:
x_train = x_train.reshape(x_train.shape[0], img_rows, img_cols, 1)
x_test = x_test.reshape(x_test.shape[0], img_rows, img_cols, 1)
input_shape = (img_rows, img_cols, 1)
請問老師範例這一段為甚麼要reshape我不太懂