TensorFlow tf.keras.losses .MeanSquaredError

Mean-square error (MSE)

mse = tf.keras.losses.MeanSquaredError()
loss = mse([0., 0., 1., 1.], [1., 1., 1., 0.])
print('Loss: ', loss.numpy())  # Loss: 0.75

 

__init__(
    reduction=losses_utils.ReductionV2.AUTO,
    name='mean_squared_error'
)

 

__call__(
    y_true,
    y_pred,
    sample_weight=None
)

 

Read More: