mse

behavenet.fitting.losses.mse(y_pred, y_true, masks=None)[source]

Compute mean square error (MSE) loss with masks.

Parameters
  • y_pred (torch.Tensor) – predicted data

  • y_true (torch.Tensor) – true data

  • masks (torch.Tensor, optional) – binary mask that is the same size as y_pred and y_true; by placing 0 entries in the mask, the corresponding dimensions will not contribute to the loss term, and will therefore not contribute to parameter updates

Returns

mean square error computed across all dimensions

Return type

torch.Tensor