skshapes.loss.lp.LpLoss

class skshapes.loss.lp.LpLoss(p=2)

Bases: BaseLoss

Lp loss for PolyData.

This class defines the L2 loss for PolyData. If X = (x_i) and Y = (y_i) are the points of two PolyData objects, the Lp loss is defined as:

\[Lp(X, Y) = \sum_i \Vert x_i - y_i \Vert^{(p/2)}\]

where \(||.||\) is the Euclidean norm.

X and Y must have the same number of points. What is more, the points must be in correspondence, i.e. x_i and y_i must correspond to the same point. If this is not the case, the loss will be meaningless, consider using a loss function based on Optimal Transport or Nearest Neighbors instead.

Parameters:

p (int | float) – the indice of the Lp Norm. Default to 2.

__init__(p=2)

Methods

__init__([p])