waxmorph.torch.losses.squared_loss#
- waxmorph.torch.losses.squared_loss(X_pred, X_target)[source]#
Squared Frobenius loss for row-aligned clouds.
\[\mathcal{L} = \lVert X^f - X^T \rVert_F^2\]Rows are fixed correspondences and shapes must match. Use
chamfer_distance()ormake_samples_loss()for unordered rows.Examples
>>> x = torch.tensor([[0.0, 0.0, 0.0], [1.0, 0.0, 0.0]]) >>> y = torch.tensor([[0.0, 0.0, 0.0], [2.0, 0.0, 0.0]]) >>> print(squared_loss(x, y)) tensor(1.)