mlx.nn.losses.mse_loss#
- class mlx.nn.losses.mse_loss(predictions: array, targets: array, reduction: str = 'none')#
Computes the mean squared error loss between predictions and targets.
- Parameters:
predictions (mx.array) – The predicted values.
targets (mx.array) – The target values.
reduction (str, optional) – Specifies the reduction to apply to the output:
'none'|'mean'|'sum'. Default:'none'.
- Returns:
The computed mean squared error loss.
- Return type:
mx.array