Function engram::loss::mse

source ·
pub fn mse(predictions: &Tensor, targets: &Tensor) -> Tensor
Expand description

Returns mean squared error between the predictions and the targets.

§Examples

let predictions = tensor![[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]];
let targets = tensor![[1.2, 2.4, 3.1], [4.4, 4.7, 5.9]];
let loss = mse(&predictions, &targets);
                         [0.16000000000000028, 0.0899999999999999, 0.009999999999999929]]);