plenoptic.loss.mse#

plenoptic.loss.mse(synth_rep, ref_rep, **kwargs)[source]#

Calculate the MSE between synth_rep and ref_rep.

For two tensors, \(x\) and \(y\), with \(n\) values each:

\[MSE = \frac{1}{n}\sum_{i=1}^n (x_i - y_i)^2\]

The two images must have a float dtype.

Parameters:
  • synth_rep (Tensor) – The first tensor to compare, model representation of the synthesized image.

  • ref_rep (Tensor) – The second tensor to compare, model representation of the reference image. must be same size as synth_rep.

  • **kwargs (Any) – Ignored, only present to absorb extra arguments.

Return type:

Tensor

Returns:

loss – The mean-squared error between synth_rep and ref_rep.