skshapes.loss.lp.LandmarkLoss

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

Bases: BaseLoss

Landmark loss for PolyData.

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

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

X and Y must have the same number of landmarks. What is more, the landmarks must be in correspondence, i.e. \(x_i\) and \(y_i\) must correspond to the same landmark. 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. Defaults to 2.

__init__(p=2)

Initialize the LandmarkLoss class.

Methods

__init__([p])

Initialize the LandmarkLoss class.