mlx.nn.losses.mse_loss

目录

mlx.nn.losses.mse_loss#

class mse_loss(predictions: array, targets: array, reduction: Literal['none', 'mean', 'sum'] = 'mean')#

Computes the mean squared error loss.

参数:
  • predictions (array) -- The predicted values.

  • targets (array) -- The target values.

  • reduction (str, optional) -- Specifies the reduction to apply to the output: 'none' | 'mean' | 'sum'. Default: 'mean'.

返回:

The computed mean squared error loss.

返回类型:

array