plenoptic.loss.relative_sse#
- plenoptic.loss.relative_sse(synth_rep, ref_rep, **kwargs)[source]#
Calculate the relative sum of squared errors between two tensors.
This is the squared L2-norm of the difference between reference representation and synthesized representation relative to the squared L2-norm of the reference representation:
For two tensors, \(x\) and \(y\):
\[\frac{||x - y||_2^2}{||x||_2^2}\]where \(x\) is
ref_rep, \(x\) issynth_rep, and \(||x||_2\) is the L2-norm.- Parameters:
- Return type:
- Returns:
loss – Ratio of the squared l2-norm of the difference between
ref_repandsynth_repto the squared l2-norm ofref_rep.