Computes the mean squared error between predictions and targets.
Usage
mlx_mse_loss(predictions, targets, reduction = c("mean", "sum", "none"))Examples
preds <- mlx_matrix(c(1.5, 2.3, 0.8), 3, 1)
targets <- mlx_matrix(c(1, 2, 1), 3, 1)
mlx_mse_loss(preds, targets)
#> mlx array []
#> dtype: float32
#> device: gpu
#> values:
#> [1] 0.1266666