- *均方误差MSE
给定一个大小为 m n的原图I和生成图K,计算均方误( MSE*)定义为:的干净图像和噪声图像,均方误差定义为:
#原图为I,生成图为K
#pytorch ——直接调用torch.nn.MSELoss()函数
function = torch.nn.MSELoss()
mse_loss = funciton(I, K)
#tensorflow 1.x
mse_loss = tf.keras.losses.MSE(I, K)
#tensorflow 2.x
mse_loss = tf.losses.MSE(I, K)