mse_loss¶
- paddle.fluid.layers.loss. mse_loss ( input, label ) [source]
-
This op accepts input predications and target label and returns the mean square error.
The loss can be described as:
\[Out = MEAN((input - label)^2)\]- Parameters
-
input (Tensor) – Input tensor, the data type should be float32.
label (Tensor) – Label tensor, the data type should be float32.
- Returns
-
The tensor storing the mean square error difference of input and label.
- Return type
-
Tensor
Return type: Tensor.
Examples
import paddle input = paddle.to_tensor([1.1, 1.9]) label = paddle.to_tensor([1.0, 2.0]) output = paddle.fluid.layers.mse_loss(input, label) print(output.numpy()) # [0.01]