我建立了一个卷积神经网络模型来生成图像作为输出。我应该使用什么错误指标来优化网络?
init_img_width = 2100// 6
init_img_height = 29 // 4
model = Sequential()
model.add(Conv2D(32, kernel_size=(5, 5), strides=(1, 1),
activation='tanh',
input_shape=(29, 105, 3)))
model.add(MaxPooling2D(pool_size=(2, 2), strides=(2, 2)))
model.add(Conv2D(64, (5, 5), activation='tanh'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Flatten())
model.add(Dense(16 * init_img_width * init_img_height))
model.add(BatchNormalization())
model.add(Activation('tanh'))
model.add(Reshape((init_img_width, init_img_height,16),input_shape=(16 * init_img_width * init_img_height,)))
model.add(UpSampling2D(size=(2, 2)))
model.add(Conv2D(64, kernel_size=5, padding='same'))
model.add(Activation('tanh'))
model.add(UpSampling2D(size=(3, 2)))
model.add(Conv2D(3, kernel_size=5, padding='same'))
model.add(Activation('tanh'))
Y_true尺寸为(2100,28,3) Y_pred尺寸为(2100,28,3)
在这种情况下,均方误差会在y_true和y_pred之间找到错误吗?