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=(xi) and Y=(yi) are the landmarks of two PolyData objects, the Lp loss is defined as:

Lp(X,Y)=ixiyi(p/2)

X and Y must have the same number of landmarks. What is more, the landmarks must be in correspondence, i.e. xi and yi 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.